Hi,
Please find the video here:
http://www.screencast.com/users/VijayBhaskar511/folders/Default/media/93fd8e58-d148-419c-9dd7-c0a21cac270d
In the video, While changing the assigneeType, we are enabling or disabling some fields in the same row. So, I am using listGrid.refreshFields() to reflect the changes.
As I have selected the Department for the AssigneeType Combobox Department Field gets enabled.So,If we are not using the refreshfields() on the grid then Department is in non editable mode.
As I am using grid.listGridFields(), The scroll is coming back to the first position in the grid.
My requirement is to stay on the same field after changing anything in the assigneeType field and other fields should get enabled/disabled depends on the assigneeType selection.
Below is the code:
Please find the video here:
http://www.screencast.com/users/VijayBhaskar511/folders/Default/media/93fd8e58-d148-419c-9dd7-c0a21cac270d
In the video, While changing the assigneeType, we are enabling or disabling some fields in the same row. So, I am using listGrid.refreshFields() to reflect the changes.
As I have selected the Department for the AssigneeType Combobox Department Field gets enabled.So,If we are not using the refreshfields() on the grid then Department is in non editable mode.
As I am using grid.listGridFields(), The scroll is coming back to the first position in the grid.
My requirement is to stay on the same field after changing anything in the assigneeType field and other fields should get enabled/disabled depends on the assigneeType selection.
Below is the code:
Code:
{name:"II1_ASSIGNEE_TYPE_V",title:formatText('<fmt:message key="label.custody.issue.detail.assignee.type"/>'),
editorType: "select",showFocused:true,
valueMap:"getCustodyTypes()",width:140, filterEditorProperties:{click:"setFilterFocus('detail')"},
changed:function(form, item, value){
//Below two arrays will change depends on the AssigneeType, I have added the below code for current situvation.
hidefieldsArray = [assigneeOffice,assigneeSection,assigneeUnit,assigneeQID,assigneeStaffNumber,assigneeRank,assigneevisaNumber];
showfieldsArray = [assigneeDepartment];
var grid = erpMasterDataView.erpGetCurrentDataView().gridObj;
for(var i=0;i<hidefieldsArray.length;i++){
grid.getField(hidefieldsArray[i]).canEdit=false;
}
for(var i=0;i<showfieldsArray.length;i++){
grid.getField(showfieldsArray[i]).canEdit=true;
}
grid.refreshFields();
}
}