jQWidgets Forums
jQuery UI Widgets › Forums › Grid › TypeScript + Grid + Expand All + Column's DataField
Tagged: typescript grid
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 5 years, 9 months ago.
-
Author
-
I have been using typescript to develop my gird. I have following questions :
1. What I need to do to expand all groups in Typescript
$.jqx.jqxGrid(‘expandallgroups’);
myGrid.expandallgroups();2. Why I can’t have the var columns = $(curGridId).jqxGrid(“columns”).records; in typescript ? Whats the alternative for the same.
Do I need to first create the instance of the grid and then use the functions ?
I have also pasted my code for reference
let options: jqwidgets.GridOptions = { width: '99%', height:'99%', source: dataAdapter, groupsrenderer: groupsrenderer, showgroupsheader: false, showgroupaggregates: false, showstatusbar: true, showaggregates: true, statusbarheight: 25, groupable: true, editable: true, theme: 'energyblue', columns:createAllColumnsArray(months), editmode: 'click', columngroups:allgroups , groups: ['Parent'], ready: function () { // $.jqx.jqxGrid('hidecolumn', 'Parent'); // $.jqx.jqxGrid('expandallgroups'); // $.jqx.jqxGrid('setcolumnproperty', 'Child', 'editable', false); myGrid.expandallgroups(); let buttonsOptions: jqwidgets.ButtonOptions = { }; var columns=columnNames(months); //populate zeros for Grid var rows = myGrid.getrows(); $.each(rows,function(i,row){ $.each(columns,function(h,column){ myGrid.setcellvaluebyid(row.uid,column,0.00); }); }); // trigger expand and collapse events. myGrid.addEventHandler('groupexpand', function (event) { let expandedgroupLog = document.getElementById(expandedgroupLogSelector); if(event.args!=null && expandedgroupLog!=null){ expandedgroupLog.innerText = "Group: " + event.args.group + ", Level: " + event.args.level; } }); myGrid.addEventHandler('groupcollapse', function (event) { let collapsedgroupLog = document.getElementById(collapsedgroupLogSelector); if(event.args!=null && collapsedgroupLog!=null){ collapsedgroupLog.innerText = "Group: " + event.args.group + ", Level: " + event.args.level; } }); } };
Hi parthrawal,
columns.records is internal API, which is used by the Grid. This property is modified by our code and we do not suggest you to use it. For Typescript we have definitions for the public API only.
Regards,
PeterjQWidgets Team
https://www.jqwidgets.comwhat could be the alternative for the same.
Hi parthrawal,
Use setcomlumnproperty to set column properties. There should not be a reason to work with the internal column objects.
Regards,
PeterjQWidgets Team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.