PxPlus User Forum

Main Board => Discussions => Webster Plus => Topic started by: Zereliq on August 16, 2022, 10:45:53 AM

Title: update dropdown [list] inside grid
Post by: Zereliq on August 16, 2022, 10:45:53 AM
Title: Re: update dropdown [list] inside grid
Post by: Mike King on August 16, 2022, 11:29:37 AM
Have you tried %webster'Bind'Reload("name_of_list")?

This should reload the list definition including any drop box values.
Title: Re: update dropdown [list] inside grid
Post by: Zereliq on August 17, 2022, 03:51:01 AM
I might be doing something wrong so here's the code I'm using and what it returns:

Code: [Select]
col Source=project_code$ ttl="project" width=30 nosort][list project_code$][data rowsep=/ valsep=: text=(project_tbl$)][/list][/col]
Code: [Select]
%WEBSTER'BIND'RELOAD("project_code$")shows the following in console: ** Could not set: project_code$ == '<select id='**UPD**' name='project_code$'></select>' **

if I do a %WEBSTER'BIND'RELOAD on the name displayed in the live html code, (grid_eiguurf1-1-project_code$) then it doesnt return anything in console
so still only updates in the background.

Title: Re: update dropdown [list] inside grid
Post by: Mike King on August 17, 2022, 08:35:58 AM
You would provide the name of the Grid so the system can update it.

Technically there is no field called project_code$ since this is a column in a grid which makes its internal name is gridname-row-project_code$ but you cannot reload a specific col/cell as its not a valid variable name.
Title: Re: update dropdown [list] inside grid
Post by: Mike King on August 17, 2022, 10:42:17 AM
Something you might want to consider when using a grid with a list if values, when the page is generated that list of values will be included in the page for each line, so if your list of values has say 20 items and your grid has 100 lines, that becomes 2000 items that will be included in the HTML form.

You might find it easier to make the field a locked input with a query and set the background color to White using the class fill_white.  This will eliminate having the list items replicated on each row of the grid.  Just set the query to a Drop Query.  Other advantages using the drop query are that you can include multiple columns in the display which may assist the end user and the data is dynamic -- i.e. loaded when the query button is clicked.

Of course this assumes that the options can be sourced from a query.
Title: Re: update dropdown [list] inside grid
Post by: Zereliq on August 23, 2022, 10:24:42 AM
Hi Mike,

Thanks for the great suggestions, my college also helped out a bit and we ended up finding a sollution.
When it comes to the amount of data working with, we dont expect a lot more than 10 maybe 15 rows at
one point loaded on the page, therefor dont think it matters how many lists we're using on set page.