This is a migrated thread and some comments may be shown as answers.

Batch Editing .. custom conditions

1 Answer 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David OBrien
Top achievements
Rank 1
David OBrien asked on 23 Aug 2012, 03:03 PM
Since I am behind a corporate firewall and have no way of giving test data to experiment I am again attaching a video in hopes someone can give me a few pointers and a nudge in the right direction....

I have a grid w/ subgrid

I have fields in the row that depending on the value of one of the fields want to have additional fields either set to editiable: true or editiable: false depending on the value of the dropdown

As you can see in the video ... if Installed or Recommended is selected from the dropdown nothing else needs to be editable

If Different is chosen all should be editable
If Not required just reason and contact

Also I am basing the dropdown on the value of the flags for the different types of justifications for each row
the id is tied to the id in the database for that row

if I wanted to change the value but display the text of the selected item in the row how could I do that?





1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 28 Aug 2012, 03:51 PM
Hi David,

Generally speaking, disabling the editing on particular cells is not supported. The field can be either editable or not and this will reflect the entire column. This can be achieved by stopping the Grid event before it reaches the Grid handler. I can suggest to add a delegated handler for cells with specific class and use the event argument stopPropagation method e.g.

var grid = $("#Grid").data("kendoGrid");
grid.tbody.on("click", ".uneditable", function (e) {
    e.stopPropagation();
});
You could use the grid DataBound and Save events to add the class initially and after the value has been changed from the dropdown.
Regarding your question about the dropdown text, you could use a ForeignKey column.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
David OBrien
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or