Show Posts
|
Pages: 1 2 [3] 4 5 6
|
33
|
General Category / EasyUI for jQuery / Layout question
|
on: July 17, 2015, 06:14:32 PM
|
Here is my layout: <div easyui-layout fit="true" style="height:88%;"> <div data-options="region:'west',title:'Asset Tree',split:true" style="width:25%;"> <div style="width:100%;height:100%"> <table assets-treegrid ng-model="assets" fit="true" pagination="true" rownumbers="true" singleselect="true" idField="id" treeField="name"></table> </div> </div> <div region="center"> <div easyui-layout fit="true"> <div data-options="region:'north',split:true" style="height:40%;"> <div style="width:1250px;height:300px;"> <table id="tt" asset-projects ng-model="assetProjects" fit="true" rownumbers="true" singleselect="true"></table> </div> </div> <div data-options="region:'center'"></div> </div> </div> </div>
What I want is when I collapse west region the table "tt" will take the whole width. but that's not happening. Any idea why? Thanks
|
|
|
37
|
General Category / EasyUI for jQuery / TreeGrid performance
|
on: July 14, 2015, 12:35:41 PM
|
I am noticing a performance degradation when a number of columns gets over 10. specifically, opening and closing nodes takes about 3-4 seconds. If I use just a few columns then it takes no time. Any idea for improving it?
Thanks
|
|
|
38
|
General Category / EasyUI for jQuery / Re: Filter TreeGrid
|
on: July 14, 2015, 12:02:26 PM
|
I am implementing filterMatcher as you are showing but it's not even get called. link: function (scope, elem, attrs, ngModel) { $(elem).datagrid({ columns: [[ { field: 'name', title: 'Name' }, { field: 'itemtype', title: 'Item Type' }, ............ ]], filterMatcher: function(data){ return scope.filterAssetProjects(data); // [b]never gets here.[/b] } }); ngModel.$render = function (value) { $(elem).datagrid('loadData', ngModel.$viewValue); } }
|
|
|
40
|
General Category / EasyUI for jQuery / Re: layout problem
|
on: July 14, 2015, 06:17:15 AM
|
Your example works perfectly, but trying it in my environment and it not is not showing anything. The only difference is that I have controller's code in the separate file. Any idea?
Thanks
|
|
|
42
|
General Category / EasyUI for jQuery / layout problem
|
on: July 13, 2015, 08:23:23 AM
|
I am trying to create the following layout: -------------------- | | | | | | | | | | | | | |---------| | | | | | | -------------------- I want to resize it vertically and horizontally. Here is my code: <div easyui-layout class="easyui-layout" style="width:70%;height:80%;" fit="true"> <div data-options="region:'west',title:'west',split:true" style="width:25%;"> </div> <div easyui-layout class="easyui-layout" region="center" fit="true"> <div data-options="region:'center',split:false"></div> <div data-options="region:'north',split:true" style="height:20%;"></div> </div> </div>
And controller: explorer.directive('easyuiLayout', function () { return { restrict: 'AE', link: function (scope, elem, attrs) { $(elem).layout(); } } });
It works at most part. My problem is when resizing it vertically first will show the right edge of the layout. Screenshot is attached. Thanks
|
|
|
43
|
General Category / EasyUI for jQuery / Re: Autosize datagrid columns
|
on: July 13, 2015, 07:38:45 AM
|
Well, yes, I can set column widths to some concrete values. But that's not a good way of designing things. Concrete values can cause problems on different screen resolutions. I am attaching another screenshot where it works automatically.
|
|
|
45
|
General Category / EasyUI for jQuery / Re: Basic pagination
|
on: July 12, 2015, 09:00:36 AM
|
I am trying to implement code the example. Just to reiterate. I put this into a separate file: (function ($) { function pagerFilter(data) { if ($.isArray(data)) { // is array data = { total: data.length, rows: data } } var dg = $(this); var state = dg.data('datagrid'); var opts = dg.datagrid('options'); if (!state.allRows) { state.allRows = (data.rows); } var start = (opts.pageNumber - 1) * parseInt(opts.pageSize); var end = start + parseInt(opts.pageSize); data.rows = $.extend(true, [], state.allRows.slice(start, end)); return data; }
var loadDataMethod = $.fn.datagrid.methods.loadData; $.extend($.fn.datagrid.methods, { clientPaging: function (jq) { return jq.each(function () { var dg = $(this); var state = dg.data('datagrid'); var opts = state.options; opts.loadFilter = pagerFilter; var onBeforeLoad = opts.onBeforeLoad; opts.onBeforeLoad = function (param) { state.allRows = null; return onBeforeLoad.call(this, param); } dg.datagrid('getPager').pagination({ onSelectPage: function (pageNum, pageSize) { opts.pageNumber = pageNum; opts.pageSize = pageSize; $(this).pagination('refresh', { pageNumber: pageNum, pageSize: pageSize }); dg.datagrid('loadData', state.allRows); } }); $(this).datagrid('loadData', state.data); if (opts.url) { $(this).datagrid('reload'); } }); }, loadData: function (jq, data) { jq.each(function () { $(this).data('datagrid').allRows = null; }); return loadDataMethod.call($.fn.datagrid.methods, jq, data); }, getAllRows: function (jq) { return jq.data('datagrid').allRows; } }) })(jQuery);
And here is my grid: <div style="width:100%;height:100%"> <table id="tg" easyui-treegrid ng-model="alarms" toolbar="#toolbar" pagination="true" fit="true" rownumbers="true" fitColumns="true" singleSelect="true" idField="id" treeField="name"> </table> </div>
Controller: alarms.directive('easyuiTreegrid', function () { return { restrict: 'AE', require: 'ngModel', link: function (scope, elem, attrs, ngModel) { $(elem).datagrid({ columns: [[ { field: 'name', title: 'Name' }, { field: 'itemtype', title: 'Item Type' }, .... ]] }); ngModel.$render = function (value) { $(elem).treegrid('loadData', ngModel.$viewValue); }; $(elem).datagrid({ data: ngModel.$viewValue }).datagrid('clientPaging'); } } });
Paging is not working for me. Please help.
Thanks
|
|
|
|