Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Not getting RowID (Primary Key) on rowSelectionChanged event when using keyboard UP/ DOWN key.
posted

Hi,

I have used igGrid control to display list of records. I have added rowSelectionChanged event to perform some action when user selects a  row. Below is the code:

Grid Initialization

 {

                    name: "Selection",

                    mode: "row",

                    multipleSelection: false,

                    touchDragSelect: false, // this is true by default

                    multipleCellSelectOnClick: false,

                    rowSelectionChanged: GetSelectedNominationPayments

                }

.

.

.

GetSelectedNominationPayments

==========================

 function GetSelectedNominationPayments(event, args) {

        if ($("#gridInvoices").data("igGrid") != null) {

            if (HasPendingTransactions($("#gridInvoices"))) {

                var answer = confirm("You have unsaved changes on this form. If you continue, you will lose these changes. Do you still wish to continue?");

                if (answer == true) {

                    $("#hdfNominationID").val(args.row.id);

                    LoadPaymentDetails(args.row.id);

                }

                else {

                    return false;

                }

            }

            else {

                $("#hdfNominationID").val(args.row.id);

                LoadPaymentDetails(args.row.id);

            }

        }

        else {

            $("#hdfNominationID").val(args.row.id);

            LoadPaymentDetails(args.row.id);

        }

    }

It works fine as long as I use mouse to select a row. But when I use Keyboard UP/DOWN arrow keys, I don't get "args.row.id"(primary key value), because of which the code is breaking. 

Please let me know how I can get row.id in this scenario.