EasyUI Forum
September 14, 2025, 06:06:21 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: error when using load method in combogrid editor in datagrid [solved]  (Read 8324 times)
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« on: January 10, 2015, 09:17:19 PM »

mornig all,

i have an error like this :

Code:
TypeError: $.fn.validatebox.methods[_36] is not a function

when i using load method in combogri editor in datagrid. here is my code:
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
« Last Edit: January 11, 2015, 01:24:38 AM by Opan Mustopah » Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 11, 2015, 01:18:37 AM »

You have to get the datagrid object before calling the 'load' method.
Code:
$(asset_sub_cat.target).combogrid('grid').datagrid('load',{
type: 'asset_sub_category',
opan: 'opopopo'
});
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #2 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:

Code:
$(asset_sub_category.target).combogrid({
queryParams:{
  type: 'asset_sub_cat',
  opan:'opopopo'
}
});

and now it works.
Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!