2

I want to share values across the two javascript functions but below in second function I am unable to get the value from the global variable

// Following two are global variables
    var grid;
    var masterTable;

    function GridCreated(sender, args)
    {
        grid = sender; // setting values
        masterTable = sender.get_masterTableView(); // setting values - Here masterTable has values in it
        masterTable.selectAllItems(true);
    }



    function abc()
    {
        debugger;
        var collectionofordernumber = 0;


               var selectedrows = mastertable.get_selecteditems(); // HERE I UNABLE TO GET THE VALUES FROM MASTERTABLE

        for (var i = 0; i < selectedrows.length; i++)
               {
                   var row = selectedrows[i];
                   var cell = mastertable.getcellbycolumnuniquename(row, "ordernumber")
           collectionofordernumber = collectionofordernumber + "-" + cell.innerhtml;
                }

        document.getelementbyid("hdf1").value = collectionofordernumber;
        alert('I m here');
    }

I want to share values across the two javascript functions but below in second function I am unable to get the value from the global variable

1 Answer 1

8

You defined the variable masterTable but are accessing it with lowercase mastertable?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.