EasyUI Forum
September 14, 2025, 07:15:16 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: issue in treegrid  (Read 17599 times)
yogesh
Newbie
*
Posts: 47


View Profile Email
« on: September 24, 2012, 03:42:32 AM »

first i am loading default data  and on the search button i am loading search result

when i am doing same in the data grid 

with below code
    var opts = $('#dg').datagrid('options');
            $('#dg').datagrid({
            pageNumber: 1,
                pageSize: opts.pageSize
            });
        loadSearchData(1, opts.pageSize);

its working  loadSearchData this function calling data from remote server

assigning the datagrid page number back to 1 and pagingcontrol is working

but same when i am doing with tree grid  treedrid number is set to 1 but paging control is not working

paging control losing property   mode: 'remote',

any sample example or is it bug in treegrid ?
Logged
anton.dutov
Newbie
*
Posts: 27


View Profile
« Reply #1 on: September 24, 2012, 06:03:38 AM »

Try
Code:
var opts = $('#dg').datagrid('options');
opts.pageNumber = 1;
loadSearchData(1, opts.pageSize);
Logged
anton.dutov
Newbie
*
Posts: 27


View Profile
« Reply #2 on: September 24, 2012, 06:07:27 AM »

Also  show the code of function loadSearchData, may be you using .datagrid  property inside
Logged
yogesh
Newbie
*
Posts: 47


View Profile Email
« Reply #3 on: September 24, 2012, 08:15:50 AM »

below is function function problem is that on click of the next page of the pager control nothing happening no remote call

      function loadSearchData(pagenumber, pagesize) {
            $('#test').treegrid('loading');
            searchData = { 'id': _txtdbid, 'filename': _txtdocname, 'doctype': _txtdoctype};
            $.ajax({
                type: "POST",
                url: "urllink",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                data: JSON.stringify(searchData),

                success: function(data) {                   
                    $('#test').treegrid('loadData', jQuery.parseJSON(data.d));
                    enableDnd($('#test'));
                    $('#test').treegrid('loaded');
                    document.getElementById('grayOut').style.display = "none";
                },
                error: function() {
                    // error.apply(this, arguments);
                }
            });
Logged
anton.dutov
Newbie
*
Posts: 27


View Profile
« Reply #4 on: September 24, 2012, 06:31:53 PM »

1.
If ajax query not send then error occurred in ajax invoking code or previous lines
possible here
Code:
searchData = { 'id': _txtdbid, 'filename': _txtdocname, 'doctype': _txtdoctype};
_txtdbid  etc. is global variables, accesible from this context?

2.
Browser contains support of JSON object (JSON.stringify) ?

3.
What output in error console?

4.
Code:
document.getElementById('grayOut').style.display = "none";
//Same
$('#grayOut').hide();

5.
For bettre performance call selector once
Code:
var tree = $('#test');
tree.treegrid('loading');
...
tree.treegrid('loadData', jQuery.parseJSON(data.d));
enableDnd(tree);
tree.treegrid('loaded');
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!