locked
LightSwitch HTML - selectedItem change event RRS feed

  • Question

  • I must be missing something simple;

    I have a screen with a table, tap event works no problem. I want to know when the user navigates using the keyboard (down/up arrow) to the next/previous item. Basically a selectedItem change event.

    I tried $(element).select(function (e) {}) on the post_render of the table and row but it doesn't fire.

    Thanks..

    Thursday, January 12, 2017 1:25 AM

Answers

  • Thanks tried your suggestion but couldn't get it to fire when the down arrow selects the next record.

    I ended up just capturing the keydown event and tracking where the user was on the form, focusing the next/previous field.

    I'm building a database driven form - the user can set the field names, control type (select, textbox, textarea, etc.), and field type (string, int, etc.).

    Working good now.

    • Marked as answer by dcagamer Thursday, February 2, 2017 5:30 PM
    Thursday, February 2, 2017 1:18 AM

All replies

  • Hi,

    You can try dataBinding on the postRender of your table:

    myapp.ScreenName.tableName_postRender = function (element, contentItem) {
        contentItem.dataBind("value.selectedItem", function (selectedItem) {
            //stuff with selectedItem
        });
    };


    Tuesday, January 17, 2017 3:31 PM
  • Thanks tried your suggestion but couldn't get it to fire when the down arrow selects the next record.

    I ended up just capturing the keydown event and tracking where the user was on the form, focusing the next/previous field.

    I'm building a database driven form - the user can set the field names, control type (select, textbox, textarea, etc.), and field type (string, int, etc.).

    Working good now.

    • Marked as answer by dcagamer Thursday, February 2, 2017 5:30 PM
    Thursday, February 2, 2017 1:18 AM