This question is locked. New answers and comments are not allowed.
Hello,
it seems there is a bug with model binding to a list. Please look at the attached sample, fill all key values and submit. With the grid the array length is always 1 whereas in the normal form it is 3.
Is there any solution for this?
Regards
it seems there is a bug with model binding to a list. Please look at the attached sample, fill all key values and submit. With the grid the array length is always 1 whereas in the normal form it is 3.
Is there any solution for this?
Regards
4 Answers, 1 is accepted
0
Dominic
Top achievements
Rank 1
answered on 25 Apr 2012, 07:42 AM
Hello,
in a form i had a similar problem. but i solved the problem like this:
in a form i had a similar problem. but i solved the problem like this:
How can i solve this problem/bug with the telerik grid? Regards$(function() {$('form').submit(function(e) {e.preventDefault();if($(this).valid()) {varlist =newArray();$(this).find('input:text[name=keys]').each(function() {list.push($(this).val());});$.ajax({url:this.action,type:this.method,traditional:true,// this line solves the problemdata: { keys: list }});}});});
0
Dominic
Top achievements
Rank 1
answered on 25 Apr 2012, 08:04 AM
Hello,
if i try this in the onSave event. Then 4 array items will be sent instead three.
if i try this in the onSave event. Then 4 array items will be sent instead three.
function onSave(e) { jQuery.ajaxSettings.traditional = true; var values = e.values; var list = new Array(); $(e.form).find('input:text[name=keys]').each(function () { list.push($(this).val()); }); values['Keys'] = list;}0
Dominic
Top achievements
Rank 1
answered on 25 Apr 2012, 02:41 PM
Hello,
i'm about to be resolved. It seems the array name is the problem. If i use an other name and traditional = true 3 items are sent. If the name is "Keys" and traditional = true 4 items are sent. Is there any explanation for this bug/behavior?
Thanks for the help!
Regards,
i'm about to be resolved. It seems the array name is the problem. If i use an other name and traditional = true 3 items are sent. If the name is "Keys" and traditional = true 4 items are sent. Is there any explanation for this bug/behavior?
Thanks for the help!
Regards,
0
Dominic
Top achievements
Rank 1
answered on 25 Apr 2012, 03:14 PM
Hello,
here is the sample project.
The last problem is that there is always a duplicate or empty entry inside the array. This problem occurs after the binding.
here is the sample project.
The last problem is that there is always a duplicate or empty entry inside the array. This problem occurs after the binding.