get the column index from a key name
New DiscussionHello Stanislas,
Thank you for posting in our community.
What I can suggest for adding an unbound column in igGrid is adding it in the columns collection as following:
.Columns(col =>{ col.For(c => c.ProductID).HeaderText("ProductID"); .
. col.Unbound("Delete").HeaderText("Delete").DataType("string").Template("<input type='button' value='Delete row' onclick='deleteRow(${ProductID})' class='delete-button'/>");})
I believe you will find the following articles in our documentation useful:
I need to get the column index from a key as selectCell requires it but the ui only gives a key name?
columnSorting: function ( evt, ui )
{
_igGridSelection.clearSelection();
var col = ui.owner.grid.columnByText(ui.columnKey);
//how to get the column I'm in?????????????
var colIndex = 1;
for (var i = 0; i < ui.owner.grid.allRows().length; i++)
_igGridSelection.selectCell(i, colIndex);
return false;
}
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
4 Created On
Mar 20, 2013 Last Post
13 years, 5 months ago