Show Posts
|
Pages: 1 [2] 3 4 ... 6
|
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
|
|
|
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
|
|
|
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: scope.assetTree = $(elem);
In controller when data has been received: $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: ..... ngModel.$render = function (value) { $(elem).treegrid('loadData', ngModel.$viewValue); }; $(elem).treegrid().treegrid('clientPaging');
markup: <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.
|
|
|
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: $(elem).treegrid({ columns: [[ { field: 'name', title: 'Name' }, ............ ]], loadFilter: scope.pagerFilter
$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: <table assets-treegrid ng-model="assets" fit="true" pagination="true" rownumbers="true" singleselect="true" idField="id" treeField="name"></table>
Controller: 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.
|
|
|
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
|
|
|
|