Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
How to set cell value based on another cell value ?
posted

I use Infragistics.Web.Mvc version 3.12.1.2023.

I define my igGrid in this way:

@( Html.Infragistics().Grid<BoletaDetalleView>()
.ID("igGridDetalle")
.PrimaryKey("Guid")

.Columns(column =>

{

column.For(x => x.Remuneracion).DataType("number").HeaderText("Remuneracion").Width("10%");
column.For(x => x.ImporteRetencion).DataType("number").HeaderText("Retencion").Width("10%");
column.For(x => x.Guid).DataType("string").HeaderText("GUID").Hidden(true);
})

.Features(features =>
{
features.Sorting().Mode(SortingMode.Single).ColumnSettings(settings =>
{
settings.ColumnSetting().ColumnKey("ApellidoNombre").AllowSorting(true);

});
features.Selection().MouseDragSelect(true).MultipleSelection(false).Mode(SelectionMode.Row);

features.Updating().EditMode(GridEditMode.Cell);

})

.ClientDataSourceType(ClientDataSourceType.JSON)
.DataSource(new List<BoletaDetalleView>().AsQueryable())
.Width("100%")
.AutoCommit(true)
.DataBind()
.Render()
)

I want to calculate a value of cell "Retencion" when I change value of "Remuneracion" . I´m using this to do the job:

$("#igGridDetalle").live("iggridupdatingeditcellending", function (event, ui) {


if (!ui.editor) {
return false;
}


if (ui.columnKey === 'Remuneracion') {

var myValue=123;
var p= $("#igGridDetalle").igGrid("setCellValue", ui.rowID,'ImporteRetencion',myValue);
return true;}

});

but the value of 'ImporteRetencion' never changes. Is there another way to do this?

Parents Reply
  • 23953
    Offline posted in reply to Cuong Tran

    Hello Cuong,

    jQuery.live function is removed from jQuery 1.9 code, so you probably have a newer version of the jQuery library referenced in your code. Try using the jQuery.on function instead.

    Here is a sample code:

    $("#igGridDetalle").on("iggridupdatingeditcellended", function (event, ui) {

    });

     

    Best regards,
    Martin Pavlov
    Infragistics, Inc. 

Children