Dynamic controls?


#1

Hello,
I need to have dynamic drop downs and text boxes on a grid. Is there a way to do that? Any pointers you can give me?
Thanks!


#2

Which Grid control are you using?

Which drop down do you mean? Is it to replace a cell in the grid?

How about the text box?


#3

Howdy,
The one under ‘common’. For the drop down the ‘select’ and for textbox the ‘textarea’. Both under JQuery.


#4

I don’t know if there is a way to embed a control into the common grid so I do this by capturing a click event in a cell. You can put a picture/image into a cell if that makes it look better but just a word or two like “Select Something” will work.

Then show a ListGroup in BS or a list in jQuery, but my favorite is to turn another grid into a scrollable list. I position the list/grid where I want, usually centered near the top. This is not, of course, a classical drop list coming out of a cell in the grid but it gets the job done. If the pseudo drop list is long and needs scrolling it is a bit more complicated when using BS. It will need to be put into a container. This has been discussed in another topic elsewhere. I avoid doing this by using the grid list method.

One other trick I use is to simulate a modal list. This is done by showing and sizing a a label to the height and width of the form with the background color set to rgba(100, 100, 100, 0.4). An onclick event in this label can show a message like: “Select something from the list first.” or just hide the list and label. This transparent label needs to be the next to last object in the Z order of the form and the grid or list control needs to be after it. One issue with a scroll-able grid over another scroll-able grid is that the scroll bar of the primary grid will “bleed through” and doesn’t always look so good.

John


#5

My challenge is that I am writing a ‘checklist type’ of application and I have a list of items that ends up being taller than the height of the screen. I need to have the header fixed in the app to give statistics as items get selected. Maybe my approach of a scrollable grid is the wrong one? is there a preferred way of doing something like that with AppStudio?


#6

If you are referring to the grid header you will have to make a separate grid at the top with just one row. It stays fixed just above your scrolling grid and you can put whatever you want into it. Unfortunately if the width of the columns change because of data in this scrolling grid the fixed header may not line up. I think there is a way to fix the column widths but don’t know how at this time. The scrolling grid needs to have its title property empty so it does not show the header of this grid.

John


#7

Not the grid header. I meant a header in the page, by that I mean an area where I show a score as items get checked. I don’t want to have the whole page scroll, that is why I selected the grid control, to only have an area of the screen scroll.


#8

Another way to do this would be to use this technique:

http://blog.nsbasic.com/2016/01/making-apps-which-scroll/

Have a look at the AppScrollAbsolute sample too.