EasyUI Forum
April 29, 2024, 07:22: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: combogrid -> post more variables besides q  (Read 13341 times)
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« on: October 28, 2013, 06:24:05 PM »

hi everybody

how can I post more variables besides q?

I've already used the queryParams property, and is helpful at te begining, but then I have another combogrid and when I change it updates this combogrid with other variables, the problem comes when I type a word, I think that the combo only sends q no my others variables.

I may think that I should use filter function but I dont know how implement

would appreciate any help

thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 28, 2013, 07:54:45 PM »

Please set 'queryParams' property to send additional parameters.
Code:
$('#cg').combogrid({
  url:...,
  queryParams:{
    param1:'value1',
    param2:'value2'
  },
  mode:'remote'
});
Logged
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« Reply #2 on: October 29, 2013, 09:01:49 AM »

thank for you reply, look here is my issue

I have this two combogrid, cg2 depends on cg1

Code:
<input class="easyui-combogrid" id="cg1" name="cg1" style="width:230px;" data-options="
panelWidth:200,
    panelHeight:305,
    idField:'key',
    textField:'name',
    url:'get_category.php',
    mode:'remote',
    fitColumns:'false',
    columns:[[
    {field:'key',title:'Id',width:60},
        {field:'name',title:'Name',width:175}
    ]],
    onHidePanel: function(){
    var g = $('#cg1').combogrid('grid');
        var r = g.datagrid('getSelected');
        var key = r.key;
        $('#cg2').combogrid('clear');
        $('#cg2').combogrid('grid').datagrid('load', {
        param1: $('#other_combo').combogrid('getValue'),
            param2: key
        });
        $('#dg').datagrid('load', {
            other_combo: $('#other_combo').combogrid('getValue'),
            cg1: key,
            cg2: $('#cg2').combogrid('getValue')
        });
}"
/>

<input class="easyui-combogrid" id="cg2" name="cg2" style="width:270px;" data-options="
    panelWidth:500,
    idField:'key',
    textField:'description',
    url:'get_products.php',
    mode:'remote',
    fitColumns:'false',
    columns:[[
            {field:'key',title:'Id',width:100},
            {field:'description',title:'Description',width:140},
            {field:'price',title:'Price',width:60}
    ]],
    queryParams: {
        param1: $('#other_combo').combogrid('getValue'),
        param2: $('#cg1').combogrid('getValue')
    },
    onHidePanel: function(){
        var g = $('#cg2').combogrid('grid');
        var r = g.datagrid('getSelected');
        var key = r.key;
        $('#dg').datagrid('load', {
            other_combo: $('#other_combo').combogrid('getValue'),
            cg1: $('#cg1').combogrid('getValue'),
            cg2: key
        });
    }"
/>

When I change a category in cg1 I notice that cg2 change his content ok, for example:

cg1 = garden

cg2 loads the content of products:

-- plantpot
-- shovel
-- fertilizer

then I change it another category:

cg1 = cleaning

cg2 loads the content of products:

-- vacuum cleaner
-- garbage bag
-- trash can

The problem is that having selected cleaning category, I write fertilizer for search and the combogrid show me the result. Looks like the param2 don't be send it in cg2

That's a mistake because fertilizer dont belong it to cleaning category

any idea?
Logged
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!