jQWidgets Forums
jQuery UI Widgets › Forums › Grid › boundindex undefined on groups
Tagged: jqxgrid group boundindex
This topic contains 3 replies, has 2 voices, and was last updated by admin 5 years ago.
-
Author
-
Hi
The sample is :
<div id=’jqxWidget’>
<div id=”jqxgrid”></div>
</div>var data = generatedata(50);
var source = {
localdata: data,
datafields: [{
name: ‘firstname’,
type: ‘string’
}, {
name: ‘lastname’,
type: ‘string’
}, {
name: ‘productname’,
type: ‘string’
}, {
name: ‘date’,
type: ‘date’
}, {
name: ‘quantity’,
type: ‘number’
}, {
name: ‘price’,
type: ‘number’
}],
datatype: “array”
};var adapter = new $.jqx.dataAdapter(source);
$(“#jqxgrid”).jqxGrid({
width: 500,
theme: ‘energyblue’,
source: adapter,
groupable: true,
groups: [‘firstname’],
columns: [{
text: ‘First Name’,
datafield: ‘firstname’,
width: 90
}, {
text: ‘Last Name’,
datafield: ‘lastname’,
width: 90
}, {
text: ‘Product’,
datafield: ‘productname’,
width: 170
}, {
text: ‘Order Date’,
datafield: ‘date’,
width: 160,
cellsformat: ‘dd-MMMM-yyyy’
}, {
text: ‘Quantity’,
datafield: ‘quantity’,
width: 80,
cellsalign: ‘right’
}, {
text: ‘Unit Price’,
datafield: ‘price’,
cellsalign: ‘right’,
cellsformat: ‘c2’
}]
});
var bRows = $(“#jqxgrid”).jqxGrid(‘getboundrows’);
alert(bRows[0].boundindex);but it returns 0 when comment => groups: [‘firstname’] line
thanks
Hi,
Groups are dynamically generated. They are not data bound so the boundindex is undefined. This is the expected behavior.
Best Regards,
PeterjQWidgets Team
https://www.jqwidgets.com/Hi Peter
That’s true, but is i comment groups on definition and grid loads with no groups and i drag columns to group manually,
the boundindex will not be undefined and the value is correct.how about that?
thanks
Hi Mehdi,
Groups do not have boundindex. You should not try to use it in your apps.
Best Regards,
PeterjQWidgets Team
https://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.