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

[Solved] Grid model property with same name as input outside of grid

1 Answer 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ben
Top achievements
Rank 1
Ben asked on 20 Mar 2012, 05:07 PM
I am using 2011.3.1306

I have an Ajax grid with a column bound to a property called StartDate. Outside of the grid is another separate form with an input with the same name. Both are using the DatePicker control. When the grid's Update button is pressed a javascript exception is thrown when the field in the external form is present. It appears as if the grid is finding both inputs and cannot set the value.

It looks like the grid is doing something like, for example:

$('input[name="StartDate"]').val(e.dataItem.StartDate)

instead of

$('.t-grid-edit-row input[name="StartDate"]').val(e.dataItem.StartDate)

I can rename one of the properties so that they don't conflict, but I was wondering if there are any other workarounds or if this is a bug, if it has been fixed in more recent/future releases.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Mar 2012, 03:22 PM
Hello Ben,

I am afraid that there is no workaround. The Grid populates the values correctly but the DatePicker initialization script needs the element ID to be unique. Since it is the same as the ID of the DatePicker outside the Grid an error is thrown.

Greetings,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Grid
Asked by
Ben
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or