locked
How to find all controls in html table row? RRS feed

  • Question

  • I'm trying to implement simple browse screen for Contract-Party-Person/Organization database. Contract-Party is simple M-1 relation, but Party can be Person or Organization (not both at same time, type defined by PartyTypeID field). Party-Person or Party-Organization organized using FK in Person or Organization table.

    I wont to show Person or Organization details in table row but hide elements not existed for current Party type.

    I think, that i need to use rows_postRender to do this, but unable to find what element of DOM associated with table columns and controls in it.

    Thursday, October 9, 2014 11:13 AM

Answers

  • You'd have to get a reference to the grid control, cast it to a Silverlight Grid, then you can do anything that you can do with a SL control.

    implement this in per control postRender event handler:

        if (contentItem.data.CustomersType.CustomerTypeID.valueOf()==null) {
            contentItem.isVisible == false;
        }

    • Edited by Mankdng Nef Tuesday, October 21, 2014 1:57 AM
    • Marked as answer by Angie Xu Thursday, October 23, 2014 3:29 AM
    Monday, October 20, 2014 2:57 AM

All replies

  • Hi,

    There is an easy way to achieve this. In add and edit table screen , you could select the fields you want to hide.

    then go to the property window .There is a Is Visible option which you could use to hide the fields.

    You could see below screen shot.


    Besides, you could place code below in any function on the screen. You could call it in event reaction.

    screen.findContentItem("ControlGroup").isVisible = false;     Or
    
    contentItem.screen.findContentItem("ControlGroup").isVisible = false;
    


    Best Regards,


    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.




    Friday, October 10, 2014 3:16 AM
  • Hello.

    I need to hide empty controls on per row basis.

    Currently i implement this in per control postRender event handler:

        if (contentItem.data.CustomersType.CustomerTypeID.valueOf() != 1) {
            contentItem.isVisible = false;
        }
    

    It work, but not easy to handle if controls will be more than 2-3.

    Friday, October 10, 2014 8:06 PM
  • You'd have to get a reference to the grid control, cast it to a Silverlight Grid, then you can do anything that you can do with a SL control.

    implement this in per control postRender event handler:

        if (contentItem.data.CustomersType.CustomerTypeID.valueOf()==null) {
            contentItem.isVisible == false;
        }

    • Edited by Mankdng Nef Tuesday, October 21, 2014 1:57 AM
    • Marked as answer by Angie Xu Thursday, October 23, 2014 3:29 AM
    Monday, October 20, 2014 2:57 AM