Home › Forum › Omnis General Forum › How to rebuild columnpicklist
-
How to rebuild columnpicklist
Posted by Obonye on April 8, 2024 at 5:41 pmHello members,
In the sample library jsDataList, the iProductCategoryList is built at the construct of the current instance, which is then assigned in the columnpicklist of the datagrid. Is there a way to rebuild this iProductCategoryList with a different data set after the window is already open and then assign it in the columnpicklist without closing the window and reopening it? I wish to pass a parameter that would determine which dataset is built in the columnpicklist.
Any help is appreciated very much.
Andreas Pfeiffer replied 3 months ago 2 Members · 26 Replies -
26 Replies
-
Hi Martin,
In the samples section there is a JS Data grid and a JS Data grid formatted. But none of them is using a droplist.
Can you please specify what library you refer?
Best,
Andreas
-
Oh! You are right. The droplist is not in the sample library. I did amend it to include the columnpicklist.
-
I hope this does not mean I cannot be helped with this droplist in a datagrid.
-
No – I can try to help.
Actually I do not think it does matter if your list is filled with data in the $construct or due to another event. So if you want the list to have a different content than simply make another load on the list.
Best,
Andreas
-
The droplist adds data at $construct. If I check the iDataList variable, it has the new data loaded but it won’t display in the datagrid property $columnpicklist assigned iDataList if I rebuild the list in the $buildList method created in the dataGrid object.
-
This reply was modified 3 months, 1 week ago by
Obonye Mato.
-
Mh – what is the purpose of changing the picklist?
-
I have a list of tables(parent) and columns(child). I wish to display the columns list as a $columnpicklist depending on the table that is selected.
-
I have created two lists. I have searched the original list that I created in the $construct and merged it with the second list (This search is not done in the construct because I want the user to select the table that will determine which columns to search). The data is populated nicely. If I assign the columnpicklist property to the second list, it does not display the data. But if I assign the columnpicklist to the original list created in the construct, the data is displayed.
-
This reply was modified 3 months, 1 week ago by
-
-
-
-
-
Martin,
I think what you want to have is a picklist with different data on each line of your grid?
I don’t think this is what the datagrid is able to do. You should probably use a complex grid for this instead.
I made you a quick sample (attached) that shows how you can achieve this using a complex grid instead. Note that the pick_list is going to be a column within the main list. That allows individual content of the picklist depending on the type of the data in the main list.
As an additional feature I added a page pane object that is controlled due to a column in the main list “type”. Check out the $dataname of the page pane object. So depending on the value of the type column in the main list it will switch the page accordingly. I placed two different icons on either page. I was using the “car” icon to indicate it is a vehicle (car, truck or motorbike).
Hope this helps. Let me know if there are additional question.
Best,
Andreas
-
-
Martin,
Just get the new Community Edition.
Best,
Andreas
-
I have downloaded the community license. It says the library you sent was not developed in Community edition. so, the community version it will not open it.
-
I beg you pardon. I will upload a CE version of this library after lunch break.
-
Martin,
CE edition library attached.
Best,
Andreas
-
Thank you for the lib. I get the idea how to go around this issue. I will try it out.
-
-
-
-
-
I’m also not sure you have understood what I want to achieve. I have attached a simple lib to show you. It is remaining a very simple step. It is not complex.
-
Ok – it shows a droplist outside of the datagrid. The datagrid remains empty.
What is your question/problem then?
You could simply load the city list when the user picks a continent in the drop list. That would then show the cities for that country, wouldn’t it?
-
This reply was modified 3 months ago by
Andreas Pfeiffer.
-
The country column in the datagrid object $columnpicklist is assigned iPickList. iPickList is merged with iCountryList after a search from iContinentList. If you check the content of iPickList, it has data but will not display in the country column. The datagrid is an insert data so no existing data to load from cities.
-
This reply was modified 3 months ago by
Obonye Mato.
-
So in fact I did understand in the first place. Please check out the library I sent you.
Best,
Andreas
-
Okay. I am well guided. I will check the lib. Thank you Sir.
-
Attached please find a modified version that might suit your needs.
Best,
Andreas
-
Note, I added a plus button to allow inserting new lines
-
-
This reply was modified 3 months ago by
-
This reply was modified 3 months ago by
-
-
-
.. although I would doubt if it makes sense to have the country list as a droplist inside the grid since a City rarely changes its country ..
-
It is a datagrid to insert cities and then assign their countries
-
To clarify, the iCityList is in insert mode. Therefore there is no existing data to determine the value of the $columndatacol. But still, i dont think the contents of iCityList should determine the picklist since it displays the countrylist in the country column even when the city list is empty.
-
Hi Martin,
I have uploaded another version that shows how you can get the countries with main cities using a rest call.
Just try jsRestTest. That form will take a little time (depending on the internet speed you have) because it reads a lot of data. Once it is open it shows a list of countries and for each country a list of cities in that country. You can use the search box to quickly find a country in that list.
Best,
Andreas
-
This reply was modified 3 months ago by
Andreas Pfeiffer.
-
This reply was modified 3 months ago by
-
Log in to reply.