EasyUI Forum
May 17, 2024, 06:12:22 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: Uncaught TypeError: Cannot read property 'hidden' of null datagrid-filter.js:386  (Read 23239 times)
fabiosan
Newbie
*
Posts: 4


View Profile
« on: May 27, 2014, 07:46:18 AM »

I'm using the last version downloaded today, i obtain this error :

Uncaught TypeError: Cannot read property 'hidden' of null datagrid-filter.js:386
createFilter datagrid-filter.js:386
init datagrid-filter.js:328
(anonymous function) datagrid-filter.js:493
x.extend.each jquery.min.js:4
x.fn.x.each jquery.min.js:4
$.extend.enableFilter datagrid-filter.js:492
$.fn.datagrid jquery.easyui.min.js:8908
(anonymous function) view:171
l jquery.min.js:4
c.fireWith jquery.min.js:4
x.extend.ready jquery.min.js:4

_______________
This my data-grid code :

 <script type="text/javascript">
                $(function(){
                    $('#dg').datagrid('enableFilter');
                    $('#dg').datagrid('enableFilter', [{
                                    field:'IDUsuario',
                                    type:'numberbox',
                                    options:{precision:1},
                                    op:['equal','notequal','less','greater']
                            }]);
                   
                    $('#dg').datagrid('resize');
                 
                });
               
   </script>

   <table id="dg" title="My Users" class="easyui-datagrid" style="width:700px;height:350px"
         url="/app/usuario/list"
         toolbar="#toolbar" pagination="true"
         rownumbers="true" fitColumns="true" singleSelect="true">
      <thead>
         <tr>
            <th field="IDUsuario" width="50" sortable="true">IDUsuario</th>
            <th field="numeroDocumento" width="50" sortable="true">Documento</th>
            <th field="FechaExpDocumento" width="50" sortable="true">FechaExpDocumento</th>
            <th field="primerNombre" width="50" sortable="true">Nombre</th>
            <th field="primerApellido" width="50" sortable="true">PrimerApellido</th>
         </tr>
      </thead>
   </table>
************************
I appreciate the help
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: May 27, 2014, 08:12:40 AM »

Please download the latest 'datagrid-filter.js' file from http://www.jeasyui.com/extension/datagrid_filter.php
Logged
fabiosan
Newbie
*
Posts: 4


View Profile
« Reply #2 on: May 29, 2014, 01:39:10 PM »

 Smiley Thx, with the new version run ok.

Buy now, when my server script return more than one record everything is fine, the grid load the data perfectly, but when the server return one row the grid dont load the row data in the grid

The server json data is fine,

{
    "total": 1,
    "rows": {
        "IDUsuario": 58,
        "numeroDocumento": "19210473",
        "FechaExpDocumento": "2014-04-30",
        "primerNombre": "LUIS",
        "segundoNombre": "ALBERTO",
        "primerApellido": "BERNAL",
        "segundoApellido": "PARADA",
        "usuario": "aparada",
        "password": "b214c5c3531225416d6a42b8a341234b77520cfe",
        "fechaTrCr": "2014-05-28 15:22:55.000",
        "usuarioTrCr": "ADMIN",
        "fechaTrEd": "2014-05-29 09:40:26.000",
        "usuarioTrEd": "ADMIN EDIT",
        "idTipoDocumento": 3,
        "RowNumber": "1"
    }
}

I don't know why with only one record don't load the record in the grid after remote filter.

********

« Last Edit: May 29, 2014, 01:55:33 PM by fabiosan » Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #3 on: May 29, 2014, 03:03:15 PM »

The rows must be an array, so the returned data should be as.
Code:
{"total":1,"rows":[{...}]}
Logged
fabiosan
Newbie
*
Posts: 4


View Profile
« Reply #4 on: May 29, 2014, 05:15:18 PM »

the data is in that format, only copy so for compression. Filter work fine with more than one record but with one record ... the data are not loaded by the grid.

{"total":1,"rows":{"IDUsuario":58,"numeroDocumento":"19210473","FechaExpDocumento":"2014-04-30","primerNombre":"LUIS","segundoNombre":"ALBERTO","primerApellido":"BERNAL","segundoApellido":"PARADA","usuario":"aparada","password":"b214c5c3531225416d6a42b8a341234b77520cfe","fechaTrCr":"2014-05-28 15:22:55.000","usuarioTrCr":"ADMIN","fechaTrEd":"2014-05-29 09:40:26.000","usuarioTrEd":"ADMIN EDIT","idTipoDocumento":3,"RowNumber":"1"}}
Logged
fabiosan
Newbie
*
Posts: 4


View Profile
« Reply #5 on: June 05, 2014, 06:27:12 AM »

Ok php json_encode return without [ ] on array length = 1

i solve this y mi php code

($response["total"] == 1)? $response["rows"][] = $list : $response["rows"] = $list;
     
        echo  json_encode($response);

Thx
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!