locked
Horizontal scroll bar for Table control (LightSwitch HTML) RRS feed

  • Question

  • I need to show about 20-25 columns in one of the table, when I run the program on my desktop browser it doesn't show the horizontal scroll bar, how can I enable it?


    Divyang Vyas


    • Edited by divyang_dv Wednesday, June 4, 2014 9:29 AM
    • Changed type divyang_dv Wednesday, June 11, 2014 9:03 AM
    Friday, May 30, 2014 8:31 AM

Answers

  • After spending some time, I learned that I can set "overflow" attribute of <div> element in which the table resides. So, in the post_render event of the table I am now setting the "overflow" attribute.

    $(element).closest(".msls-content").css("overflow", "auto");

    This works perfectly fine on a screen with only one table element on a screen. I'll now try to make it work with multiple table element on one screen.


    Divyang Vyas

    • Marked as answer by divyang_dv Wednesday, June 11, 2014 9:04 AM
    Tuesday, June 10, 2014 3:43 PM

All replies

  • The DataGrid control grows a horizontal scrollbar automatically if the columns will not fit in its width.

    Could the bottom of the grid have disappeared off the bottom of the screen?

    If this doesn't answer your question, please post screenshots of design-time and run-time.


    Simon Jones
    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, please remember to "Mark as Answer". This will help other people find answers to their problems more quickly.

    Friday, May 30, 2014 10:28 AM
  • Simon, I think the OP is referring to the Table control in the HTML client.

    Regards, Xander. My Blog

    Friday, May 30, 2014 10:52 AM
  • Yes, he might be. Hence requesting screenshots to clarify.

    Simon Jones
    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, please remember to "Mark as Answer". This will help other people find answers to their problems more quickly.

    Friday, May 30, 2014 10:55 AM
  • I apologize for not explaining the scenarios. the question is for the Table control in HTML Client.

    Here is the screen shot,  actually I need to show 30 days availability of workers. 



    Divyang Vyas

    Friday, May 30, 2014 11:32 AM
  • Divyang, I'm not in front of my computer now, but what happens if you give the Table control a fixed Width that is wide enough to display all columns? Or alternatively putting the Table inside another Group Control and setting a fixed Width on that?

    Regards, Xander. My Blog


    • Edited by novascape Friday, May 30, 2014 11:57 AM
    Friday, May 30, 2014 11:57 AM
  • Thanks Xander for the reply, I've tried both but it's not working, it only shows vertical scroll bar.

    Divyang Vyas

    Friday, May 30, 2014 12:41 PM
  • After spending some time, I learned that I can set "overflow" attribute of <div> element in which the table resides. So, in the post_render event of the table I am now setting the "overflow" attribute.

    $(element).closest(".msls-content").css("overflow", "auto");

    This works perfectly fine on a screen with only one table element on a screen. I'll now try to make it work with multiple table element on one screen.


    Divyang Vyas

    • Marked as answer by divyang_dv Wednesday, June 11, 2014 9:04 AM
    Tuesday, June 10, 2014 3:43 PM
  • hi Divyang, i have the same exact issue and your code almost fixed it. Thing is the horizontal scroll bar is overlapping the last record of the table. any idea how i can put place the bar after the last record?

    thks

    Wednesday, June 1, 2016 10:46 AM
  • Can you tell me where in the light switch application I would put this code?  I'm not sure if I need to replace ".msls-conent" with a name from my app?
    • Edited by mjanach Tuesday, October 25, 2016 10:22 PM Added more information
    Tuesday, October 25, 2016 9:42 PM
  • mjanach,

    This would go in the _postRender method of your table. And you do not need to modify divyang_dv's code at all. It worked for me too but I had the same problem as ravibeeharry, the scrollbar overlaps the last record a bit. Not a big issue but it would be nice to have that fixed.

    Jeremy


    Jeremy

    Thursday, December 22, 2016 7:21 PM