jQWidgets Forums

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts

  • fenderEvrby
    Participant

    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!!


    fenderEvrby
    Participant

    Hi, 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!!

Viewing 2 posts - 1 through 2 (of 2 total)