jQWidgets Forums
Forum Replies Created
-
Author
-
May 9, 2014 at 4:29 pm in reply to: url action from jqxgrid source can't run url action from jqxgrid source can't run #54293
Sorry, my mistake. I forgot to paste that part of code in my last post, but the rest is the same and behavior as I described. Here is the code updated with “POST”
$.each(myArray, function (index) {
var valueToProcess = myArray[index];
var source =
{
datatype: “son”,
datafields: [
{ name: ‘SELECTION’, type: ‘bool’ },
{ name: ‘VALUE1’, type: ‘string’ },
{ name: ‘STATUS’, type: ‘char’ },
{ name: ‘VALUE2’, type: ‘string’ }
],
id: ‘id’,
traditional: true,
url: ‘@(Url.Action(“UpdateValue”,”api/WebApi”))’,
data: ({ param1: $(“#Param1”).val(), date: $(“#jqxWidget”).val(), values: valueToProcess, routes: arrayRuotes, status: $(“#Status”).val(), filter: $(“#Filter”).val() }),
type: ‘POST’
};
………………It sends next error: “Microsoft JScript runtime error: unable to get value of property ’0′: object is null or undefined”.
Actually, it only updates 1 field into the database and then sends the error it put above.Thanks!!
May 9, 2014 at 2:26 pm in reply to: url action from jqxgrid source can't run url action from jqxgrid source can't run #54283Hi, Peter. Thanks for your help. I modified the code as you suggested but it is still not running. I tried to use a loop before the var source
and I used the ‘valueToProcess’ variable in the data attribute of the source variable. Here is the code:$.each(myArray, function (index) {
var valueToProcess = myArray[index];
var source =
{
datatype: “json”,
datafields: [
{ name: ‘SELECTION’, type: ‘bool’ },
{ name: ‘VALUE1’, type: ‘string’ },
{ name: ‘STATUS’, type: ‘char’ },
{ name: ‘VALUE2’, type: ‘string’ }
],
id: ‘id’,
traditional: true,
url: ‘@(Url.Action(“UpdateValue”,”api/WebApi”))’,
data: ({ param1: $(“#Param1″).val(), date: $(“#jqxWidget”).val(), values: valueToProcess, routes: arrayRuotes, status: $(“#Status”).val(), filter: $(“#Filter”).val() }),
type: ‘GET’
};
……………..When I test my code, it sends me the next error: “Microsoft JScript runtime error: unable to get value of property ‘0’: object is null or undefined”
Can you help me?
Thanks anyway!! -
AuthorPosts