EasyUI Forum
May 05, 2024, 10:21:48 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: Datagrid sorting  (Read 10150 times)
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« on: July 09, 2012, 04:04:44 AM »

When using a remote json source and enabling the sorting on certain columns, the sort event seems to reload the external json data, this is an unwanted action.

The columns don't get sorted when clicked, what can be the cause?

Code:
jQuery('#studentNr').combogrid({
        mode: 'remote',
        width: 200,
        panelWidth: 400,
        fitColumns: true,
        idField: 'key',
        textField: 'emplid',
        striped: 'true',
        loadMsg: 'Gegevens worden opgehaald, een ogenblik ....',
        rownumbers: 'true',
        singleSelect: 'true',
        columns: [[
            {field:'surname',title:'Achternaam',width:180,sortable:true},
            {field:'initials',title:'Initialen',width:40},
            {field:'emplid',title:'Studentnr.',width:80,sortable:true}
        ]],
        onSelect: function(rowIndex,rowData){
        // Populate the input fields from the returned values
        },
        onBeforeLoad: function(param){
            if (!param.q || param.q.length<5) return false;
        },
        loader: function(param,success,error){
            jQuery.ajax({
url: 'GMActionController.do?myaction=getPersonsByAjax&principalDisplayMode=principalIsisCode',
cache: false,
dataType: 'json',
data: {
personIdOrSurname: param.q,
roleType: 'student'
},
                success: function(data){
                    success(data.personRecordSet);
                },
                error: function(jqXHR, textStatus, errorThrown) {
console.log(errorThrown); console.log(textStatus);
}
            });
        }
    });
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!