EasyUI Forum
May 16, 2024, 09:18:44 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: 1 [2] 3 4 ... 6
16  General Category / EasyUI for jQuery / Treegrid Dynamic load on: July 28, 2015, 06:12:28 AM
I am looking into the following example:
http://www.jeasyui.com/tutorial/tree/treegrid3_demo.html

and cannot understand how does it know to go a get children when a node is expanded?

Thanks
17  General Category / EasyUI for jQuery / Treegrid dynamically change data on: July 28, 2015, 01:18:40 AM
My data for treegrid looks like this:
$scope.assets = { total: rows.length, rows: rows };

At some point I am adding more elements to $scope.assets.rows but I dont see new data in the treegrid. Should I refresh it somehow?

Thanks
18  General Category / EasyUI for jQuery / Re: TreeGrid - All nodes are expanded after loadData call on: July 27, 2015, 06:28:57 AM
<Without using 'loadFilter' or any specific loading or extend logics,

That's exactly the same question I have. How does your sample work without any custom code?
19  General Category / EasyUI for jQuery / Re: Understanding data structure for treegrid on: July 24, 2015, 09:43:49 AM
Are you sure you are answering my question?
20  General Category / EasyUI for jQuery / Understanding data structure for treegrid on: July 24, 2015, 02:36:10 AM
Can you explain different hierarchical  data structures for a treegrid? What I understand is that basically we can use either an xml or a json format. With an xml we have to to do some client side processing. We have to create an object with two properties: total, and an array: rows. Two fields idfield and _parentId are used to show a hierarchy. Now, with json examples I dont see any client side data processing before showing it. But how does it know the hierarchy? Seems like a json data needs to be fully prepared in order to show hierarchy? Is that correct?

Thanks
21  General Category / EasyUI for jQuery / Errors loading datagrid or treegrid on: July 22, 2015, 12:02:19 PM
Any time I am loading these components Console shows the following errors:
TypeError: Cannot read property 'parent' of undefined
    at HTMLTableElement.<anonymous> (jquery.easyui.min.js:11541)
    at Function.m.extend.each (jquery.min.js:2)
    at m.fn.m.each (jquery.min.js:2)
    at Object.$.fn.treegrid.methods.loadData (jquery.easyui.min.js:11540)
    at Object.$.fn.treegrid.methods.loadData (datagrid-filter.js:31)
    at $.extend.loadData (datagrid-clientpaging.js:64)
    at $.fn.treegrid (jquery.easyui.min.js:11509)
    at ngModel.$render (ExplorerController.js:22)
    at Object.<anonymous> (angular.js:25165)
    at n.$get.n.$digest (angular.js:15677)(anonymous function) @ angular.js:12332$get @ angular.js:9111$get.n.$digest @ angular.js:15703$get.n.$apply @ angular.js:15953l @ angular.js:10366F @ angular.js:10538K.onload @ angular.js:10479
angular.js:12332 TypeError: Cannot read property 'length' of undefined
    at HTMLTableElement.$.fn.datagrid.defaults.$.extend.loadFilter (jquery.easyui.min.js:10579)
    at _64b (jquery.easyui.min.js:9237)
    at HTMLTableElement.<anonymous> (jquery.easyui.min.js:10127)
    at Function.m.extend.each (jquery.min.js:2)
    at m.fn.m.each (jquery.min.js:2)
    at Object.$.fn.datagrid.methods.loadData (jquery.easyui.min.js:10126)
    at Object.$.fn.datagrid.methods.loadData (datagrid-filter.js:24)
    at $.fn.datagrid (jquery.easyui.min.js:9888)
    at ngModel.$render (ExplorerController.js:87)
    at Object.<anonymous> (angular.js:25165)

Should I be concerned about these errors?

Thanks
22  General Category / EasyUI for jQuery / Re: Expend a specific node in TreeGrid on: July 22, 2015, 11:55:49 AM
I tried both a number and a string. The result is very consistent - nothing.
23  General Category / EasyUI for jQuery / Re: Expend a specific node in TreeGrid on: July 22, 2015, 08:41:30 AM
Console shows it as "1". I tried it too, same.
24  General Category / EasyUI for jQuery / Expend a specific node in TreeGrid on: July 22, 2015, 07:55:52 AM
I am trying to programmatically open first node in the treegrid after having all nodes collapsed.
Here is my code.
In directive as the last line in Link finction:
Code:
scope.assetTree = $(elem);

In controller when data has been received:
Code:
$scope.assetTree.treegrid('expand', 1);

Nothing happens, the first node is not expended.

Please help.

Thanks
25  General Category / EasyUI for jQuery / Re: Client pagination on: July 21, 2015, 11:01:25 AM
I am using code for the example.
My controller:
Code:
.....
ngModel.$render = function (value) {
                $(elem).treegrid('loadData', ngModel.$viewValue);
            };
$(elem).treegrid().treegrid('clientPaging');

markup:
Code:
<div style="width:100%;height:100%">
    <table id="tg" alarms-treegrid ng-model="alarms" pagination="true" pageSize="30" fit="true"
            rownumbers="true" fitColumns="true" singleSelect="true" idField="id" treeField="name">
    </table>
</div>

And all the code that starts with (function($){ .....  has been copied into a separate file which is loaded in the main page.

The screen comes up with a pager that shows 30, but the Next button is disabled.
26  General Category / EasyUI for jQuery / Re: TreeGrid performance on: July 21, 2015, 10:43:43 AM
Using code from the linked tread helped the problem. But still, in IE 11 on windows 7 it's horrible. It takes about 20 secs to get data on screen. It takes less than 5 in Chrome.
27  General Category / EasyUI for jQuery / Client pagination on: July 20, 2015, 07:25:21 AM
I am trying to setup a client pagination. Here is my code:
Code:
$(elem).treegrid({
                columns: [[
                    { field: 'name', title: 'Name' },
                     ............
                ]],
                loadFilter: scope.pagerFilter

Code:
$scope.pagerFilter = function (data) {
        var dg = $(this);
        var opts = dg.treegrid('options');
        var pager = dg.treegrid('getPager');
        pager.pagination({
            onSelectPage: function (pageNum, pageSize) {
                opts.pageNumber = pageNum;
                opts.pageSize = pageSize;
                pager.pagination('refresh', {
                    pageNumber: pageNum,
                    pageSize: pageSize
                });
                dg.treegrid('loadData', data);
            }
        });
        if (!data.originalRows) {
            data.originalRows = (data.rows);
        }
        var start = (opts.pageNumber - 1) * parseInt(opts.pageSize);
        var end = start + parseInt(opts.pageSize);
        data.rows = (data.originalRows.slice(start, end));
        return data;
    }

Does not work at all.
Can some please help?

Thanks
28  General Category / EasyUI for jQuery / Re: Row numbers are all zeros on: July 19, 2015, 06:22:52 PM
Table markup:
Code:
<table assets-treegrid ng-model="assets" fit="true" pagination="true" 
                   rownumbers="true" singleselect="true" idField="id" treeField="name"></table>

Controller:
Code:
explorer.directive('assetsTreegrid', function () {
    return {
        restrict: 'AE',
        require: 'ngModel',
        link: function (scope, elem, attrs, ngModel) {
            $(elem).treegrid({
                columns: [[
                    { field: "name", title: "Name", width: "92%" }
                ]],
                onSelect: scope.assetChanged
            });
            ngModel.$render = function (value) {
                $(elem).datagrid('loadData', ngModel.$viewValue);
            }
        }
    }
});

.......
 $scope.assets = { total: rows.length, rows: rows };
The same technique works for a number other tables including treegrids.
29  General Category / EasyUI for jQuery / Re: Basic pagination on: July 19, 2015, 05:34:52 AM
I have also found this example:
http://www.aa.org/js/jquery-easyui/demo/datagrid/clientpagination.html

I am trying to understand how come it does work without setting 'clientPaging' anywhere.

Can you please provide a little explanation of how does pagination work in your product?

Thanks
30  General Category / EasyUI for jQuery / Re: Basic pagination on: July 19, 2015, 05:22:19 AM
It does not work. First of all, the grid comes up with a vertical scroll bar which is wrong already. Clicking on pager Next button triggers some kind of event and then pager buttons become disabled and it says Page 0 of 0.
Please tell me how I can trouble shoot it.
Here is how I am setting up client paging on the my treegrid after data has been loaded:

ngModel.$render = function (value) {
                $(elem).treegrid('loadData', ngModel.$viewValue);
            }
$(elem).treegrid('clientPaging');

Thanks
Pages: 1 [2] 3 4 ... 6
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!