I am loading an Infragistics grid. When loading I have a template column that needs to inspect another value in the dataset before it knows what to load. It doesn't look like Infragistics will let me do this so I need to run a query on the grid after it is loaded to hide/show certain info.
For example:
My Grid:
$("#divGrid").igGrid({
columns: [
{
headerText: "",
width: "70px",
key: "Division",
template: ProperRights.GetTemplate("${Division}")
}
],
primaryKey: "EmployeeNumber",
autoGenerateColumns: false,
dataSource: AccountAdministrationGrid.GetGridData()
});
My js template logic:
var ProperRights = new function () {
this.GetTemplate = function(division) {
if (division === 'DIV1') {
return 'Special Stuff';
} else {
return "Boring Stuff";
}
};
};
That is what I would like to do, but the ProperRights.GetTemplate just returns ${Division} instead of the grid rows value.
So my next approach was to add a .ready() on the end of the grid. Then loop through each td and piece out the values from the row and change my values in the first column manually like so:
.ready(function () {
$("td").each(function () {
var id = $(this).text();
console.log(id);
});
});
But that does not work either, it keeps coming back as 0 td's found like the grid has not loaded yet.