Please provide any example for conditional column template which highlights the iggrid's cell with background color.
http://jsfiddle.net/zLRRN/1/
$(function () { var columnSettings = [ { headerText: "Product Name", key: "ProductName" , template: "{{if ${ProductName} == 'Chai' }}one{{else}}two{{/if}}" } ]; $('#resultGrid').igGrid({ dataSource: northwindProducts, responseDataKey: "results", dataSourceType: "json", width: "100%", autoGenerateColumns: true, columns: columnSettings, features: [ { name: "Paging", type: "local", pageSize: 8 } ] }); });
Hello,
Is there a better solution to this yet? Seems like there is a need for a cellTemplate as well as the normal template? What is the expectation to deal with these situations with changing data coming in? ie, I'm using angular and data in my grid is coming in and can change dynamically after it has already been rendered in the grid. I want to add angular directives on the td cell element itself to add additional css class to control the background color of the entire cell. How can I do this?
I am having an issue getting this to work. When I attempt to execute grid.getCellValue() I get error : "The record with the specified id could not be found in the data view: 0"
in the ui.grid.framework.js
//CODE
$.ajax({
type: 'POST',
url: '../../../webservices/FeeScheduleWebService.asmx/GetAllNonRPSFeeSchedules',
dataType: 'json',
global: false,
contentType: 'application/json; charset=UTF-8',
success: function (result) {
$("#grid").igGrid({
rendered: function (evt, ui) {
$('#loading').igLoading("hide");
indicatorLoading.hide();
$('.t-area').find('h1').text($('#grid').igGrid('option', 'dataSource').length + ' Fee Schedule(s)');
$('#grid').show();
},
dataSourceType: "json",
primaryKey: "FeeScheduleId",
responseContentType: "application/json; charset=utf-8",
width: "100%",
dataSource: result.d,
autoGenerateColumns: true,
features: [
{
name: "Paging",
type: "local",
pageSize: 8,
pagerRendered: function (evt, ui) {
var grid = ui.owner.grid;
for (var i = 0; i < grid.rows().length; i++) {
var value = grid.getCellValue(i, "ScheduleTypeName");
var columnIndex = $("#" + grid.id() + "_" + "IsDefault").data("columnIndex");
if (value === 'Business Acquisition and Consulting Services Fees' || value === 'Additional Fees') {
$(grid.cellAt(columnIndex, i)).css('background-color', 'yellow');
}
]
});
Hi,
I am using .cshtml file so we need C#/Jquery vesrion for this HTML code
I need c# code for following code
If there is anything else that I can do for you, contact me.