locked
LightSwitch 2013 - Disable a record RRS feed

  • Question

  • Hey,

    I'm building a LightSwitch 2013 HTML application.

    I have a table\tile-list and i want to disable one record from tapping (with a look of a disabled element).

    I'd tried to search for something like --> screen.TableName[i].isDisabled = true , but there isn't.

    How do I do that?

    Thanks.

    Sunday, July 10, 2016 7:10 AM

Answers

  • Hi!

    You can create custom method for screen tap, and then in it's "can execute" function return your boolean from the row data, something like:

    return !contentItem.isDisabled; //or whatever your property is called..

    for disabled look you can just play with css style of the element in post render method (

    if (contentItem.IsDisabled) $(element).css(...);

    perhaps you'll need to insert "contentItem.value.isDisabled", not at VS right now.. hth..

    Kivito


    Nobody expects the Spanish Inquisition! (M.P.F.C.)


    • Edited by Kivito Tuesday, July 12, 2016 6:12 PM
    • Proposed as answer by Angie Xu Thursday, July 21, 2016 5:07 AM
    • Marked as answer by Angie Xu Thursday, July 21, 2016 5:07 AM
    Tuesday, July 12, 2016 6:07 PM

All replies

  • Hi Yaron,

    I don't think it is feasible to disable one cell in the table, it's recommended to set that cell to readonly.

    column.ReadOnly = false;

    Regards,

    Angie 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, July 12, 2016 7:12 AM
  • Hey Angie,

    Thanks for your reply.

    I don't want to disable a cell. I want to disable a record (a row on the table) so that the user could see the record but not select it.

    The ReadOnly can be good for me, but the question is, how do i make a specific record (a row) to be read only?

    Thanks.

    Tuesday, July 12, 2016 7:49 AM
  • Hi!

    You can create custom method for screen tap, and then in it's "can execute" function return your boolean from the row data, something like:

    return !contentItem.isDisabled; //or whatever your property is called..

    for disabled look you can just play with css style of the element in post render method (

    if (contentItem.IsDisabled) $(element).css(...);

    perhaps you'll need to insert "contentItem.value.isDisabled", not at VS right now.. hth..

    Kivito


    Nobody expects the Spanish Inquisition! (M.P.F.C.)


    • Edited by Kivito Tuesday, July 12, 2016 6:12 PM
    • Proposed as answer by Angie Xu Thursday, July 21, 2016 5:07 AM
    • Marked as answer by Angie Xu Thursday, July 21, 2016 5:07 AM
    Tuesday, July 12, 2016 6:07 PM