EasyUI Forum
May 04, 2024, 08:58:20 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 strange behavior  (Read 7460 times)
pratikk
Newbie
*
Posts: 49


View Profile Email
« on: February 04, 2014, 10:15:11 PM »

This is my combogrid ;

  $('#cg_odanum').combogrid({
        panelWidth: 130,
        url: 'odalar_getdata.php',
        idField: 'odano',
        textField: 'odano',
        mode: 'remote',
        fitColumns: false,
        columns: [
            [
                {
                    field: 'odano', title: 'Oda No', width: 60, sortable: true
                },
                {
                    field: 'tip', title: 'Tip', width: 50
                }
            ]
        ]
    });


If I dont use the below code the combogrid works fine, but when I use the code below,

1) The combogrid search function don't work as aspected. For example: If  I type "a"  it doesn't find the lines which has "a" inside. After typing the whole text then it finds it.
2) fitColumns definition is set to false. If I don't use the code below it works fine, but when The code below starts working  , The combogrid behaves like the fitColumns is set to true.


  $('#cg_odanum').combogrid({
        onChange: function() {
            var modano = $('#cg_odanum').combogrid('getValue');
            var modatip = "";

    if(modano != "") {
        var cgrid = $('#cg_odanum').combogrid('grid');   // get datagrid object
        var rowgrid = cgrid.datagrid('getSelected');   // get the selected row
        modatip = rowgrid.tip;
        $("#cg_odatip").combogrid('setValue', modatip);
        $('#cg_odatip').combogrid('readonly', true);
    } else {
        $("#cg_odatip").combogrid('setValue', '');
        $('#cg_odatip').combogrid('readonly', false);
    }
        }
    });

Is this a bug ? or can I find another way to solve this. All I want is to trigger a function  using  combogrid's onchange event
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!