Hi,
Version : Smartclient-v9 pro.
Browser : Chrome Version 31.0.1650.63 m & IE11 Version :11.0.9600.16518
Issue : Multiple Blank area below the records in 'SelectItem' (Please see the attached image)
Description: When property 'allowEmptyValue' is set to 'true' and property 'sortField' is set to a field which is not mentioned in 'pickListFields' property, then, on initial load of 'SelectItem' we see multiple blank rows\records\area (Please see the attached file). This happens only for first time. Subsequent clicks will not show this problem. In the below code snippet, 'picktListFields' does not include 'presentationOrder' which is the 'sortField'
Probable issue:
We figured out the issue to be in the file ISC_Grid.js
File : ISC_Grid.js
Method : sort : function (sortFieldNum, sortDirection)
Line : 56188
From the above code, the first segment, as shown below,
gets the index of the 'sortFieldName' from the 'pickListFields'. But 'sortFiledName' does not exists and -1 is returned. So it enters the IF statement and getUnderlyingField() method tries to get the sortFiledName from the Data Source, but datasource is not yet loaded. Hence sortField will have NULL value.
So the control does not enter the next IF statement which sets all the properties (Sort field, order etc.) and control will return in the next IF statement.
And this explains the reason why the issue shows up only for first time (as Data Source is not loaded at that point) and in subsequent clicks, it works.
Please confirm if this is an issue. If yes, please suggest a fix.
Thank you
Anand L
Version : Smartclient-v9 pro.
Browser : Chrome Version 31.0.1650.63 m & IE11 Version :11.0.9600.16518
Issue : Multiple Blank area below the records in 'SelectItem' (Please see the attached image)
Description: When property 'allowEmptyValue' is set to 'true' and property 'sortField' is set to a field which is not mentioned in 'pickListFields' property, then, on initial load of 'SelectItem' we see multiple blank rows\records\area (Please see the attached file). This happens only for first time. Subsequent clicks will not show this problem. In the below code snippet, 'picktListFields' does not include 'presentationOrder' which is the 'sortField'
Code:
getPeriodLevelPickerFieldDefinition : function(properties)
{
var baseProperties =
{
name : 'level',
hint : MeiStrings.get('period.hint.periodLevel'),
width : 150,
defaultToFirstOption : true,
optionDataSource : 'dsPeriodLevel',
editorType : 'SelectItem',
displayField : 'name',
sortDirection : 'ascending',
valueField : 'primaryKey',
addUnknownValues : false,
validateOnExit : false,
allowEmptyValue : true,
sortField : 'presentationOrder',
pickListFields : [{ name : 'name', width : '100%' }],
criteriaProperties : null,
config : null
};
var fld = isc.addProperties(baseProperties, properties);
return fld;
}We figured out the issue to be in the file ISC_Grid.js
File : ISC_Grid.js
Method : sort : function (sortFieldNum, sortDirection)
Line : 56188
Code:
_$sort:"sort",
sort : function (sortFieldNum, sortDirection) {
var sortFieldName,
sortField
;
if (isc.isA.String(sortFieldNum)) {
// sortFieldNum is actually a sortFieldName
sortFieldName = sortFieldNum;
sortFieldNum = this.getFieldNum(sortFieldName);
if (sortFieldNum < 0) {
// the field isn't visible - it might still be in completeFields if specified
// as hidden in lg.fields, or it might only appear in the DS
sortField = this.getUnderlyingField(sortFieldName);
}
}
if (!sortField) {
// remember the current sortField num and direction for redrawing sorter images
var oldSortFieldNum = this._getSortFieldNum(),
oldSortDirection =
(oldSortFieldNum != null ?
Array.shouldSortAscending(this.getField(oldSortFieldNum).sortDirection) :
null);
// if no sortField was specified, assume sorting by the current sort field if there is
// one, or the first sortable field otherwise.
if (sortFieldNum == null) {
if (oldSortFieldNum != null) {
sortFieldNum = oldSortFieldNum;
} else {
// if this.sortFieldNum is null, default to the first sortable field
for (var i = 0; i < this.fields.length; i++) {
if (this._canSortData(this.fields[i]) != false) {
sortFieldNum = i;
break;
}
}
}
}
// if sortFieldNum is still null, no fields are sortable and we should bail
if (sortFieldNum == null) return false;
sortField = this.getField(sortFieldNum);
}
// if we have no sortField, bail!
if (sortField == null) {
return;
}Code:
if (isc.isA.String(sortFieldNum)) {
// sortFieldNum is actually a sortFieldName
sortFieldName = sortFieldNum;
sortFieldNum = this.getFieldNum(sortFieldName);
if (sortFieldNum < 0) {
// the field isn't visible - it might still be in completeFields if specified
// as hidden in lg.fields, or it might only appear in the DS
sortField = this.getUnderlyingField(sortFieldName);
}
}So the control does not enter the next IF statement which sets all the properties (Sort field, order etc.) and control will return in the next IF statement.
And this explains the reason why the issue shows up only for first time (as Data Source is not loaded at that point) and in subsequent clicks, it works.
Please confirm if this is an issue. If yes, please suggest a fix.
Thank you
Anand L