formsTable.requestTypeSM = new Ext.grid.CheckboxSelectionModel(); formsTable.requestTypeDS = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({url:'ajax2/Gemini?action=demand.web.ajax.GetAllFormRequestTypesAction'}), reader: new Ext.data.JsonReader({}, [ {name: 'requestTypeId'}, {name: 'name'}, {name: 'selected'} ]) }); formsTable.requestTypeDS.on('load', function(store, records, options) { if (records.length > 0) { var a = new Array(); for (var i = 0; i < records.length; i++) { if (records[i].get('selected')) { a[i] = records[i]; } } formsTable.requestTypeSM.selectRecords( a ); } }); formsTable.requestTypeGridPanel = new Ext.grid.GridPanel({ ds: formsTable.requestTypeDS, cm: new Ext.grid.ColumnModel([ formsTable.requestTypeSM, {id:'requestTypeId',header: "$requesttype_title_text", width: 220, sortable: false, dataIndex: 'name'} ]), sm: formsTable.requestTypeSM, title: '$form_applicability_text', bodyStyle:'padding:5px 5px 0', id: 'requestTypes', width: 230, //height: 320, autoScroll: true }); formsTable.statusSM = new Ext.grid.CheckboxSelectionModel(); formsTable.statusDS = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({url:'ajax2/Gemini?action=demand.web.ajax.GetAllFormStatusesAction'}), reader: new Ext.data.JsonReader({}, [ {name: 'statusId'}, {name: 'name'}, {name: 'selected'} ]) }); formsTable.statusDS.on('load', function(store, records, options) { if (records.length > 0) { var a = new Array(); for (var i = 0; i < records.length; i++) { if (records[i].get('selected')) { a[i] = records[i]; } } formsTable.statusSM.selectRecords( a ); } }); formsTable.statusGridPanel = new Ext.grid.GridPanel({ ds: formsTable.statusDS, cm: new Ext.grid.ColumnModel([ formsTable.statusSM, {id:'statusId',header: "$requesttype_title_text", width: 220, sortable: false, dataIndex: 'name'} ]), sm: formsTable.statusSM, title: '$form_applicability_status_text', bodyStyle:'padding:5px 5px 0', id: 'statuses', width: 230, //height: 320, autoScroll: true }); formsTable.associationSM = new Ext.grid.CheckboxSelectionModel(); formsTable.associationDS = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({url:'ajax2/Gemini?action=demand.web.ajax.GetAllFormAssociationsAction'}), reader: new Ext.data.JsonReader({}, [ {name: 'associationId'}, {name: 'name'}, {name: 'selected'} ]) }); formsTable.associationDS.on('load', function(store, records, options) { if (records.length > 0) { var a = new Array(); for (var i = 0; i < records.length; i++) { if (records[i].get('selected')) { a[i] = records[i]; } } formsTable.associationSM.selectRecords( a ); } }); formsTable.associationGridPanel = new Ext.grid.GridPanel({ ds: formsTable.associationDS, cm: new Ext.grid.ColumnModel([ formsTable.associationSM, {id:'associationId',header: "$requesttype_title_text", width: 220, sortable: false, dataIndex: 'name'} ]), sm: formsTable.associationSM, bodyStyle:'padding:5px 5px 0', title: '$form_applicability_association_text', id: 'statuses', width: 230, //height: 320, autoScroll: true }); formsTable.applicabilityPanel = new Ext.Panel({ //defaults: {width: 630}, height: 370, frame: true, waitMsgTarget: true, //bodyStyle:'padding:5px 5px 0', autoScroll: true, layout: 'column', items:[{ width:"33%", items: [ formsTable.requestTypeGridPanel ] }, { width:"33%", items: [ formsTable.statusGridPanel ] }, { width:"33%", items: [ formsTable.associationGridPanel ] } ] });