locked
Build an array from a button instead on using dataBind RRS feed

  • Question

  • Scenario

    I have programmed a way to compare 2 arrays against each other, it works by comparing a list of serial lists from one table, and compares them against a list the user has entered. I have however come across an issue with building the array which the user inputs

    Issue

    by using this code below:

    myapp.EditOutbound.SerialNo_postRender = function (element, contentItem) {

        contentItem.dataBind("value", function (newValue) {
            if (contentItem.value != null) {
                serialArray.push(contentItem.value);
            }
            else {
            }

        });
    }

    I can successfully compile an array of all data serialArray entered by a user as they type, however if they accidently type something wrong, then that value is still stored, aswell as the new data i replace it with. this means when im comparing it against the actual stock array, it returns and error, although that value does not exist anymore on the order table.

    Question

    Is there a way to compile an array on a button press, using the dataBind technique above? so rather than it building as the user enters serials, it builds once when the user presses a button? I have tried adding a function around the above code block, however this returns null values, any other suggestions would be most welcome.

    This is with Lightswitch HTML


    Crezzer7




    • Edited by Crezzer777 Wednesday, April 13, 2016 7:47 AM
    Wednesday, April 13, 2016 7:29 AM

All replies

  • It's a little confused, do you have any progress?
    Wednesday, April 27, 2016 9:55 AM