Title: error when using load method in combogrid editor in datagrid [solved]
Post by: Opan Mustopah on January 10, 2015, 09:17:19 PM
mornig all, i have an error like this : TypeError: $.fn.validatebox.methods[_36] is not a function
when i using load method in combogri editor in datagrid. here is my code: {field: 'asset_cat', title: "Asset Cat", align: 'left', halign: 'center', width:100,sortable:true, editor: { type: 'combogrid', options: { required: true, tipPosition: 'top', url: '#{lookup_lov_path}', queryParams:{type:'asset_category'}, mode:'remote', method:'get', idField:'lov_id', textField: 'lov_name', fitColumns: true, height:22, panelWidth: 250, onShowPanel:function(){ return rowHeight(this);}, onSelect:function(index,row){ var row = $list_data.datagrid('getSelected'); var idx = $list_data.datagrid('getRowIndex',row); var asset_sub_cat = $list_data.datagrid('getEditor',{index:idx,field:'asset_sub_cat'}); var opt = $(asset_sub_cat.target).combogrid('options'); $(asset_sub_cat.target).combogrid('load',{ type: 'asset_sub_category', opan: 'opopopo' }); }, onLoadSuccess:function(data){return clearFirstCombogrid(state, this);}, columns:[[{field:'lov_name',title:'Asset Category',width:100,sortable:true}]] } } }, {field: 'asset_sub_cat', title: "Asset Sub Cat", align: 'left', halign: 'center', width:100,sortable:true, editor: { type: 'combogrid', options: { required: true, tipPosition: 'top', url: '#{lookup_custom_lov_path}', queryParams:{type:'asset_sub_category'}, mode:'remote', method:'get', idField:'lov_id', textField: 'lov_name', fitColumns: true, height:22, panelWidth: 250, onShowPanel:function(){ return rowHeight(this);}, columns:[[{field:'lov_name',title:'Asset Category',width:100,sortable:true}]] } } }
did i miss something? what i want with that code is when i select on asset_cat combogrid, then i load asset_sub_cat combogrid with new parameter, or new url, that's all many thanks for the answer
Title: Re: error when using load method in combogrid editor in datagrid
Post by: stworthy on January 11, 2015, 01:18:37 AM
You have to get the datagrid object before calling the 'load' method. $(asset_sub_cat.target).combogrid('grid').datagrid('load',{ type: 'asset_sub_category', opan: 'opopopo' });
Title: Re: error when using load method in combogrid editor in datagrid
Post by: Opan Mustopah on January 11, 2015, 01:24:27 AM
thanks stworthy for your replay. now it solved. but finally i'm not using load method, but just overrid it with queryParams like this: $(asset_sub_category.target).combogrid({ queryParams:{ type: 'asset_sub_cat', opan:'opopopo' } });
and now it works.
|