PDA

View Full Version : Store.group method is not working as expected



AtulDawkhare
25 Nov 2011, 1:07 AM
Hi There,
I have a Grid, I want to do custom Grouping on the Grid. For that I have added buttons on the Grid tbar.
But when I do store.group( 'Field name','Direction'); It is not giving me the same result as that I get when I use groupField , groupDir in the store..

Please suggest If I am doing anything wrong here.

Here is my code.
Store


var Store = Ext.create('Ext.data.Store', {
model: 'Model',
proxy: {
autoSave: true,
autoSync:true,
type: 'memory',
data:data,

reader:
{
root: 'root',
totalProperty: 'totalCount'
},
writer:
{
type: 'json',
writeAllFields: true,
allowSingle: true,
encode: true,
root: 'row'
},
directionParam:'_sortOrder',
sortParam:'_sortColumn',
pageParam:'equipmentBoMListingGrid__page',
simpleSortMode: true}
,groupField: 'ExtJSGroupByHiddenColumn',groupDir :'DESC'
, });


And I am doing

Store.group("ExtJSGroupByHiddenColumn","DESC");


Please suggest me here.

tobiu
25 Nov 2011, 2:14 AM
looks fine to me in case you want local grouping.

if you can create a small complete testcase, i can move the topic to the bugs section.

AtulDawkhare
25 Nov 2011, 3:43 AM
Yes, Here is my complete working code..

for now I have commented the GroupField. Please have a look at it and suggest if anything is wrong here





Ext.Loader.setConfig({enabled: true});


Ext.Loader.setPath('Ext.ux', '/javascript/extjs');


Ext.require(['Ext.ux.PreviewPlugin']);


Ext.onReady(function(){


Ext.tip.QuickTipManager.init();


Ext.define('equipmentBoMListingGrid_Model', {extend: 'Ext.data.Model',
fields: ['equipmentBoMListingGrid_jsonHidden','equipmentBoMListingGrid_location','equipmentBoMListingGrid_partNumber','equipmentBoMListingGrid_description','equipmentBoMListingGrid_qty','equipmentBoMListingGrid_vendor','equipmentBoMListingGrid_editjsonHidden','equipmentBoMListingGrid_deletejsonHidden','equipmentBoMListingGrid_validatejsonHidden','equipmentBoMListingGrid_ExtJSGroupByHiddenColumn'],
idProperty: 'equipmentBoMListingGrid_partNumber'});


var data = {"totalCount": "0",root_equipmentBoMListingGrid: [{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='5' type='text' class='frm-extjs-input' name='webBoQ_qty_363629' id='webBoQ_qty_363629' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>UC540W-BRI-K9</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363629,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363629)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"UC540W-BRI-K9","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"363629\",className:null,comment:null,description:\"UC 540 system with 2 BRI, 4 FXS, and 1 VIC expansion slot\",processed:\"false\",partNumber:\"UC540W-BRI-K9\",quantity:\"5\",quantity:\"5\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363629\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:null,validateStatus:\"NOT_VALIDATED\",isDummyObject:\"false\",productName:\"UC540W-BRI-K9\",locationSiteId:\"43179\",groupAction:null,idAction:null,software:\"false\",validationMessage:\"Configuration check with Cisco is not performed for at least one of the products.You can do that either by clicking Requester Services(the computer icon on menu bar) or alternatively validate all button on right. You may or may not see these options depending on your license.\",includedPart:\"false\",entityID:\"363629\",locationSiteName:\"Core\",autoAdded:\"false\",idActionString:\"363629\",groupActionString:\"363629\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>UC 540 system with 2 BRI, 4 FXS, and 1 VIC expansion slot</label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 363629, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363629,UC540W-BRI-K9,CISCO)</label>"},
{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='1' type='text' class='frm-extjs-input' name='webBoQ_qty_363628' id='webBoQ_qty_363628' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CAB-AC</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363629,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363629)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"UC540W-BRI-K9","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"363628\",className:null,comment:null,description:\"\",processed:\"false\",partNumber:\"CAB-AC\",quantity:\"1\",quantity:\"1\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363629\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:\"UC540W-BRI-K9\",validateStatus:null,isDummyObject:\"false\",productName:\"UC540W-BRI-K9\",locationSiteId:\"43179\",groupAction:null,idAction:null,software:\"false\",validationMessage:null,includedPart:\"false\",entityID:\"363628\",locationSiteName:\"Core\",autoAdded:\"false\",idActionString:\"363628\",groupActionString:\"363629\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'></label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 363628, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363629,UC540W-BRI-K9,CISCO)</label>"},
{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='1' type='text' class='frm-extjs-input' name='webBoQ_qty_363630' id='webBoQ_qty_363630' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>VWIC2-1MFT-T1/E1</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363629,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363629)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"UC540W-BRI-K9","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"363630\",className:null,comment:null,description:\"\",processed:\"false\",partNumber:\"VWIC2-1MFT-T1/E1\",quantity:\"1\",quantity:\"1\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363629\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:\"UC540W-BRI-K9\",validateStatus:null,isDummyObject:\"false\",productName:\"UC540W-BRI-K9\",locationSiteId:\"43179\",groupAction:null,idAction:null,software:\"false\",validationMessage:null,includedPart:\"false\",entityID:\"363630\",locationSiteName:\"Core\",autoAdded:\"false\",idActionString:\"363630\",groupActionString:\"363629\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'></label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 363630, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363629,UC540W-BRI-K9,CISCO)</label>"},
{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='1' type='text' class='frm-extjs-input' name='webBoQ_qty_363638' id='webBoQ_qty_363638' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CP-7925G-W-K9</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363638,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363638)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"CP-7925G-W-K9","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"363638\",className:null,comment:null,description:\"Cisco 7925G FCC; Battery/Power Supply Not Included\",processed:\"false\",partNumber:\"CP-7925G-W-K9\",quantity:\"1\",quantity:\"1\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363638\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:null,validateStatus:\"VALIDATION_OK\",isDummyObject:\"false\",productName:\"CP-7925G-W-K9\",locationSiteId:\"43181\",groupAction:null,idAction:null,software:\"false\",validationMessage:\"Product was submitted to Cisco and no error was found in the current configuration.\",includedPart:\"false\",entityID:\"363638\",locationSiteName:\"Wiring Closet\",autoAdded:\"false\",idActionString:\"363638\",groupActionString:\"363638\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>Cisco 7925G FCC; Battery/Power Supply Not Included</label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 363638, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363638,CP-7925G-W-K9,CISCO)</label>"},
{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='1' type='text' class='frm-extjs-input' name='webBoQ_qty_363681' id='webBoQ_qty_363681' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CP-BATT-7925G-STD=</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363638,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363638)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"CP-7925G-W-K9","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"363681\",className:null,comment:null,description:\"\",processed:\"false\",partNumber:\"CP-BATT-7925G-STD=\",quantity:\"1\",quantity:\"1\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363638\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:\"CP-7925G-W-K9\",validateStatus:null,isDummyObject:\"false\",productName:\"CP-7925G-W-K9\",locationSiteId:\"43181\",groupAction:null,idAction:null,software:\"false\",validationMessage:null,includedPart:\"false\",entityID:\"363681\",locationSiteName:\"Wiring Closet\",autoAdded:\"false\",idActionString:\"363681\",groupActionString:\"363638\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'></label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 363681, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363638,CP-7925G-W-K9,CISCO)</label>"},
{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='1' type='text' class='frm-extjs-input' name='webBoQ_qty_387869' id='webBoQ_qty_387869' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>SW-CCM-UL-7925G</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363638,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363638)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"CP-7925G-W-K9","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"387869\",className:\"7925 USER LIC OPT[2]\",comment:null,description:\"Communication Manager 4.x License for single Cisco 7925G\",processed:\"false\",partNumber:\"SW-CCM-UL-7925G\",quantity:\"1\",quantity:\"1\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363638\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:\"CP-7925G-W-K9\",validateStatus:null,isDummyObject:\"false\",productName:\"CP-7925G-W-K9\",locationSiteId:\"43181\",groupAction:null,idAction:null,software:\"false\",validationMessage:null,includedPart:\"false\",entityID:\"387869\",locationSiteName:\"Wiring Closet\",autoAdded:\"false\",idActionString:\"387869\",groupActionString:\"363638\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>Communication Manager 4.x License for single Cisco 7925G</label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 387869, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363638,CP-7925G-W-K9,CISCO)</label>"},
{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='1' type='text' class='frm-extjs-input' name='webBoQ_qty_387950' id='webBoQ_qty_387950' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div style='background-color:#CCFFFF;width:100%;height:100%;overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CP-7925G-SW-K9-W</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363638,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363638)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"CP-7925G-W-K9","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"387950\",className:null,comment:null,description:\"Cisco 7925G Software, Rest of World\",processed:\"false\",partNumber:\"CP-7925G-SW-K9-W\",quantity:\"1\",quantity:\"1\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363638\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:\"CP-7925G-W-K9\",validateStatus:null,isDummyObject:\"false\",productName:\"CP-7925G-W-K9\",locationSiteId:\"43181\",groupAction:null,idAction:null,software:\"false\",validationMessage:null,includedPart:\"true\",entityID:\"387950\",locationSiteName:\"Wiring Closet\",autoAdded:\"false\",idActionString:\"387950\",groupActionString:\"363638\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>Cisco 7925G Software, Rest of World</label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 387950, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363638,CP-7925G-W-K9,CISCO)</label>"},
{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='1' type='text' class='frm-extjs-input' name='webBoQ_qty_363644' id='webBoQ_qty_363644' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CP-7937G=</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363644,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363644)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"CP-7937G=","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"363644\",className:null,comment:null,description:\"Cisco UC Conference Station 7937 Global\",processed:\"false\",partNumber:\"CP-7937G=\",quantity:\"1\",quantity:\"1\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363644\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:null,validateStatus:null,isDummyObject:\"false\",productName:\"CP-7937G=\",locationSiteId:\"43181\",groupAction:null,idAction:null,software:\"false\",validationMessage:\"Configuration check with Cisco is not performed for at least one of the products.You can do that either by clicking Requester Services(the computer icon on menu bar) or alternatively validate all button on right. You may or may not see these options depending on your license.\",includedPart:\"false\",entityID:\"363644\",locationSiteName:\"Wiring Closet\",autoAdded:\"false\",idActionString:\"363644\",groupActionString:\"363644\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>Cisco UC Conference Station 7937 Global</label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 363644, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363644,CP-7937G=,CISCO)</label>"},
{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='1' type='text' class='frm-extjs-input' name='webBoQ_qty_363648' id='webBoQ_qty_363648' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CP-7937-MIC-KIT=</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363644,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363644)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"CP-7937G=","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"363648\",className:null,comment:null,description:\"Microphone Kit (7 ft) for 7937\",processed:\"false\",partNumber:\"CP-7937-MIC-KIT=\",quantity:\"1\",quantity:\"1\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363644\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:\"CP-7937G=\",validateStatus:null,isDummyObject:\"false\",productName:\"CP-7937G=\",locationSiteId:\"43181\",groupAction:null,idAction:null,software:\"false\",validationMessage:null,includedPart:\"false\",entityID:\"363648\",locationSiteName:\"Wiring Closet\",autoAdded:\"false\",idActionString:\"363648\",groupActionString:\"363644\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>Microphone Kit (7 ft) for 7937</label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 363648, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363644,CP-7937G=,CISCO)</label>"},
{"equipmentBoMListingGrid_qty":"<div style='width:100%;height:100%;text-align:right;white-space:nowrap;'><input value='1' type='text' class='frm-extjs-input' name='webBoQ_qty_363649' id='webBoQ_qty_363649' style='width:95%;text-align:right;'/></div>","equipmentBoMListingGrid_partNumber":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CP-7937-PWR-SPL=</label></div>","equipmentBoMListingGrid_location":"<div class='col-gray'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>&#160;</label></div>","equipmentBoMListingGrid_vendor":"<div class='col-gray' style='width:100%;height:100%;padding-left:10px;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>CISCO</label></div>","equipmentBoMListingGrid_validatejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>validateWebbomObject(363644,35684352)</label>","equipmentBoMListingGrid_deletejsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>deleteSolutionEntity(363644)</label>","equipmentBoMListingGrid_ExtJSGroupByHiddenColumn":"CP-7937G=","equipmentBoMListingGrid_jsonHidden":"<label class='frm-lbl' id='' style='display:none;'>{id:\"363649\",className:null,comment:null,description:\"Power Splitter for 7937\",processed:\"false\",partNumber:\"CP-7937-PWR-SPL=\",quantity:\"1\",quantity:\"1\",siteId:\"43178\",vendorName:\"CISCO\",groupID:\"363644\",visibleForEditServicePart:null,modelType:null,specialAttributes:\"0\",orderNo:null,deliveryTypeTermId:null,parentPartNumber:\"CP-7937G=\",validateStatus:null,isDummyObject:\"false\",productName:\"CP-7937G=\",locationSiteId:\"43181\",groupAction:null,idAction:null,software:\"false\",validationMessage:null,includedPart:\"false\",entityID:\"363649\",locationSiteName:\"Wiring Closet\",autoAdded:\"false\",idActionString:\"363649\",groupActionString:\"363644\"}</label>","equipmentBoMListingGrid_description":"<div class='col-gray' style='overflow:hidden;white-space:nowrap;'><label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>Power Splitter for 7937</label><img src='/images/common/comment-edit.png' title='Comment' class='frm-image' id='shortcut' style='cursor:pointer;vertical-align:top;float:right;' onclick='editWebBomComment(event, 363649, \"\")'/></div>","equipmentBoMListingGrid_editjsonHidden":"<label class='frm-lbl' id='' style='overflow:auto;white-space: normal;'>editWebBomObject(this,363644,CP-7937G=,CISCO)</label>"},
]}

;


var equipmentBoMListingGrid_Store = Ext.create('Ext.data.Store', {
model: 'equipmentBoMListingGrid_Model',



proxy: {
autoSave: true,
autoSync:true,
type: 'memory',
data:data,

reader:
{
root: 'root_equipmentBoMListingGrid',
totalProperty: 'totalCount'
},
writer:
{
type: 'json',
writeAllFields: true,
allowSingle: true,
encode: true,
root: 'row'
},
directionParam:'_sortOrder',
sortParam:'_sortColumn',
pageParam:'equipmentBoMListingGrid__page',
simpleSortMode: true}
//,groupField: 'equipmentBoMListingGrid_ExtJSGroupByHiddenColumn',groupDir :'DESC'
, });


var pluginExpanded = true;
var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{groupHeaderTpl: '{name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})',startCollapsed:false});


var tbar = Ext.create('Ext.toolbar.Toolbar', {
items : [{
xtype: 'tbtext',
text: 'Groupers:',

}
, '-'],

});


function getGroupers() {
var groupers = [];


Ext.each(tbar.query('button'), function(button) {
groupers.push(button.groupData);
}, this);


return groupers;
}
function doGroup() {
equipmentBoMListingGrid_Store.group(getGroupers(),"DESC");
}
function changeGroupDirection(button, changeDirection) {
var groupData = button.groupData,
iconCls = button.iconCls;

if (groupData) {
if (changeDirection !== false) {
button.groupData.direction = Ext.String.toggle(button.groupData.direction, "DESC", "DESC");
}
//clearFilter
equipmentBoMListingGrid_Store.clearGrouping();
doGroup();
}
}
function createGrouperButtonConfig(config) {
config = config || {};
Ext.applyIf(config, {
listeners: {
click: function(button, e) {
changeGroupDirection(button, true);
}
},
iconCls: 'group-' + config.groupData.direction.toLowerCase(),
reorderable: true,
xtype: 'button'
});
return config;
}
tbar.add(createGrouperButtonConfig({
text: 'Default Grouping',
groupData: {
property: 'equipmentBoMListingGrid_ExtJSGroupByHiddenColumn',
direction: 'DESC'
}
}));
/*
tbar.add(createGrouperButtonConfig({
text: 'Parent Part',
groupData: {
property: 'equipmentBoMListingGrid_partNumber',
direction: 'ASC'
}
}));


tbar.add(createGrouperButtonConfig({
text: 'desc',
groupData: {
property: 'equipmentBoMListingGrid_description',
direction: 'ASC'
}
}));*/

var grid_equipmentBoMListingGrid = Ext.create('Ext.grid.Panel',
{
tbar : tbar,
forceFit: true,
sortableColumns:false,
errorSummary:false ,
store: equipmentBoMListingGrid_Store,
disableSelection: true,
loadMask: true,
viewConfig: { emptyText: 'No records',id: 'gv_equipmentBoMListingGrid', trackOver: false, stripeRows: false, plugins: [{ptype: 'preview', bodyField: 'excerpt', expanded: true, pluginId: 'preview'}]} ,


listeners: {
itemcontextmenu: function(view,record,item,index,e,eOpts) {
var menu= new Ext.menu.Menu();
menu.add({text:"Copy Record",handler: function (){
var rec = equipmentBoMListingGrid_Store.getAt(index);
var NewName=rec.get('name');
var NewState=rec.get('state');
var NewDisplayName=rec.get('displayName');
var NewStatus=rec.get('status');
var r = Ext.ModelManager.create(
{
name:NewName,
state:NewState,
displayName:NewDisplayName,
status:NewStatus}, 'equipmentBoMListingGrid_Model');
equipmentBoMListingGrid_Store.insert(0, r);
equipmentBoMListingGrid_Store.sync();}});
menu.add({text:"Delete Record",handler: function(){equipmentBoMListingGrid_Store.load();var sm = grid.getSelectionModel();equipmentBoMListingGrid_Store.removeAt(index); equipmentBoMListingGrid_Store.sync();} }); e.stopEvent();menu.showAt(e.xy);
} ,


groupcontextmenu:function (view,node,group,e,eOpts) { var menu= new Ext.menu.Menu(); menu.add({text:"Edit",icon: 'images/common/edit.png',handler: function() { var my_store = view.getStore() ; var values= equipmentBoMListingGrid_Store.queryBy(function(record) { return record.get(my_store.groupers.first().property)==group });var editFunctionName=getFunctionName(values.getAt(0).data['equipmentBoMListingGrid_editjsonHidden']);var editArguments=getFunctionArguments(values.getAt(0).data['equipmentBoMListingGrid_editjsonHidden']);window[editFunctionName].apply(null,editArguments.split(',')); }}); menu.add({text:"Delete",icon: 'images/common/delete.png',handler: function() { var my_store = view.getStore() ; var values= equipmentBoMListingGrid_Store.queryBy(function(record) { return record.get(my_store.groupers.first().property)==group });var deleteFunctionName=getFunctionName(values.getAt(0).data['equipmentBoMListingGrid_deletejsonHidden']); var deleteArguments=getFunctionArguments(values.getAt(0).data['equipmentBoMListingGrid_deletejsonHidden']);window[deleteFunctionName].apply(null,deleteArguments.split(',')); }}); menu.add({text:"Validate",icon: 'images/common/validate.png',handler: function() { var my_store = view.getStore() ; var values= equipmentBoMListingGrid_Store.queryBy(function(record) { return record.get(my_store.groupers.first().property)==group }); var validateFunctionName=getFunctionName(values.getAt(0).data['equipmentBoMListingGrid_validatejsonHidden']); var validateArguments=getFunctionArguments(values.getAt(0).data['equipmentBoMListingGrid_validatejsonHidden']);window[validateFunctionName].apply(null,validateArguments.split(',')); }}); e.stopEvent(); menu.showAt(e.xy);}


} ,






columns:[
{id: 'equipmentBoMListingGrid_location',width: 15,text: 'Location',dataIndex: 'equipmentBoMListingGrid_location',filter: {type: 'string'},sortable: false

},
{id: 'equipmentBoMListingGrid_partNumber',width: 20,text: 'Product Part #',dataIndex: 'equipmentBoMListingGrid_partNumber',filter: {type: 'string'},sortable: false },
{id: 'equipmentBoMListingGrid_description',width: 40,text: 'Description',dataIndex: 'equipmentBoMListingGrid_description',filter: {type: 'string'},sortable: false },
{id: 'equipmentBoMListingGrid_qty',width: 10,text: 'Quantity',dataIndex: 'equipmentBoMListingGrid_qty',filter: {type: 'string'},sortable: false },
{id: 'equipmentBoMListingGrid_vendor',width: 15,text: 'Vendor',dataIndex: 'equipmentBoMListingGrid_vendor',filter: {type: 'string'},sortable: false }
/*,{id: 'equipmentBoMListingGrid_ExtJSGroupByHiddenColumn',width: 15,text: 'Grouping',dataIndex: 'equipmentBoMListingGrid_ExtJSGroupByHiddenColumn',filter: {type: 'string'},sortable: false }*/

],
features: [ groupingFeature],
renderTo: 'equipmentBoMListingGrid_Div' ,
viewConfig: {forceFit: true,stripeRows: true} });





equipmentBoMListingGrid_Store.loadPage(1);});