Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum How to rebuild columnpicklist

  • How to rebuild columnpicklist

    Posted by Obonye on April 8, 2024 at 5:41 pm

    Hello 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
  • Andreas Pfeiffer

    Administrator
    April 9, 2024 at 7:06 am

    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

    • Obonye

      Member
      April 9, 2024 at 9:33 am

      Oh! You are right. The droplist is not in the sample library. I did amend it to include the columnpicklist.

      • Obonye

        Member
        April 9, 2024 at 11:07 am

        I hope this does not mean I cannot be helped with this droplist in a datagrid.

        • Andreas Pfeiffer

          Administrator
          April 9, 2024 at 12:15 pm

          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

          • Obonye

            Member
            April 9, 2024 at 1:21 pm

            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.
            • Andreas Pfeiffer

              Administrator
              April 9, 2024 at 2:49 pm

              Mh – what is the purpose of changing the picklist?

            • Obonye

              Member
              April 9, 2024 at 3:40 pm

              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.

            • Obonye

              Member
              April 9, 2024 at 5:06 pm

              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.

  • Andreas Pfeiffer

    Administrator
    April 10, 2024 at 9:22 am

    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

    • Obonye

      Member
      April 10, 2024 at 9:39 am

      I’m using version 31896 on web. This lib will not run.

      • Andreas Pfeiffer

        Administrator
        April 10, 2024 at 9:57 am

        Martin,

        Just get the new Community Edition.

        Best,

        Andreas

        • Obonye

          Member
          April 10, 2024 at 10:24 am

          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.

    • Obonye

      Member
      April 10, 2024 at 9:47 am

      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.

      • Andreas Pfeiffer

        Administrator
        April 10, 2024 at 10:04 am

        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?

        • Obonye

          Member
          April 10, 2024 at 10:08 am

          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.
  • Andreas Pfeiffer

    Administrator
    April 10, 2024 at 10:17 am

    .. 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 ..

    • Obonye

      Member
      April 10, 2024 at 10:23 am

      It is a datagrid to insert cities and then assign their countries

    • Obonye

      Member
      April 10, 2024 at 11:15 am

      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.

    • Andreas Pfeiffer

      Administrator
      April 10, 2024 at 2:58 pm

      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

Log in to reply.