Moving of a column from one position to another position

Moving of a column from one position to another position

  

Hi,

Is it possible to move one column of the table records to another position in the browser? If so, Can you please guide me. 

Regards,

Trinusha.

Hi Trinusha,


I think you need to use the similar logic to drag and drop below is the example form forge items, you can search "Drag and Drop".


For reference you can download and check, modify the code according to your need.


https://www.outsystems.com/forge/component/294/drag-n-drop-sortable-list/ 


Thanks

Ramakrushna Rao Seera

Hi Trinusha,

This is unfortunately not possible, at least not runtime. Design time, you can use the "Move Column" button in Service Studio:

Kilian Hekhuis wrote:

Hi Trinusha,

This is unfortunately not possible, at least not runtime. Design time, you can use the "Move Column" button in Service Studio:

Hi,

I am aware of the button in Service Studio but I am worried about the runtime, Is there any alternative.

Regards,

Trinusha.

Ramakrushna Rao Seera wrote:

Hi Trinusha,


I think you need to use the similar logic to drag and drop below is the example form forge items, you can search "Drag and Drop".


For reference you can download and check, modify the code according to your need.


https://www.outsystems.com/forge/component/294/drag-n-drop-sortable-list/ 


Thanks

Ramakrushna Rao Seera

Hi Ramakrushna,

I just downloaded it from the forge. Can you suggest me how to use this weblock, In my module.


Regards,

Trinusha.


Hi Trinusha,

I think that Ramakrushna unfortunately gave just a very generic answer, one which I think doesn't apply to your use case. The problem is, among others, that when refreshing or reloading the screen, OutSystems has no idea you moved columns, so they will return to their initial state. Also, knowing the way an HTML table is built, you can't just drag and drop entire columns (tables are row-oriented).

Kilian Hekhuis wrote:

Hi Trinusha,

I think that Ramakrushna unfortunately gave just a very generic answer, one which I think doesn't apply to your use case. The problem is, among others, that when refreshing or reloading the screen, OutSystems has no idea you moved columns, so they will return to their initial state. Also, knowing the way an HTML table is built, you can't just drag and drop entire columns (tables are row-oriented).


Hi Kilian,

Thank you for the explanation.

Regards,

Trinusha.

Hi Kilian,

I have one more doubt. Is it possible to provide multiple sorts for a table in the runtime?

Regards,

Trinusha.


Hi Trinusha,

Yes, but depending on your use case it may be easier or more difficult. The standard way to sort tables is by using the RichWidgets' List_SortColumn Widget in conjunction with List_SortColumn_GetOrderBy and List_SortColumn_SetOrderBy. This is what the default scaffolding in Service Studio does:

This however will only allow you (and the user) to sort on a single column. You might be able to work around this, but it will be complex, and I'm not entirely sure it works.

Alternatively, you can provide such functionality yourself, by adding a link to the column headers or add an icon (or multiple, depending on what you need) and link to a Screen Action that performs the sorting by using a Dynamic Sort (like in the auto-generated example above) and sorts on multiple columns at once. This means keeping the sort state per column, and probably the sort order as well, but it _is_ doable I think, though perhaps not something a novice developer would like to burn their hands on...


Well, there's a JQuery plugin for that, but I don't know if it can be integrated with the platform:

https://www.jqueryscript.net/table/Simple-jQuery-Plugin-For-Draggable-Table-Columns-Dragtable.html

Also, as Kilian said, since this works entirely on the client's browser, if you refresh the page any changes will be reset.

Kilian Hekhuis wrote:

Hi Trinusha,

Yes, but depending on your use case it may be easier or more difficult. The standard way to sort tables is by using the RichWidgets' List_SortColumn Widget in conjunction with List_SortColumn_GetOrderBy and List_SortColumn_SetOrderBy. This is what the default scaffolding in Service Studio does:

This however will only allow you (and the user) to sort on a single column. You might be able to work around this, but it will be complex, and I'm not entirely sure it works.

Alternatively, you can provide such functionality yourself, by adding a link to the column headers or add an icon (or multiple, depending on what you need) and link to a Screen Action that performs the sorting by using a Dynamic Sort (like in the auto-generated example above) and sorts on multiple columns at once. This means keeping the sort state per column, and probably the sort order as well, but it _is_ doable I think, though perhaps not something a novice developer would like to burn their hands on...



Hi,

Thank you for detail explanation. In my case, If you observe the below image First I want to sort with the Check-in(Column) in ascending order and thenGuestFirstName (Column) in ascending order.


For example: If I first select Check-out, and then Guest First Name. It should display like below:

                    Guest First Name                               Check Out

                              A                                                   Today

                             B                                                    

                              C                                             

                              D                      

                            Cat                                                Yesterday

                             dog


Regards,

Trinusha.

Hi guys,

I've implemented a forge component for moving table columns at runtime:

https://www.outsystems.com/forge/component/1789/dragtable/

Edit: It also supports persisting the column order based on a session variable or storing it in the database to persist across sessions.

Thanks,

Justin

Justin Babel wrote:

Hi guys,

I've implemented a forge component for moving table columns at runtime:

https://www.outsystems.com/forge/component/1789/dragtable/

Edit: It also supports persisting the column order based on a session variable or storing it in the database to persist across sessions.

Thanks,

Justin

Hi,

I downloaded the drag table module but When I am opening it in the browser, It is showing the following error. Actually, I am new to outsystems. I don't know how to use other modules in my module. Can you please explain in detail.

When I published the below page



It is showing the below error.


Hi Trinusha,

Did you download the components dependencies as well?

What error are you seeing in the Service Center error logs?

Thanks,

Justin

Justin Babel wrote:

Hi Trinusha,

Did you download the components dependencies as well?

What error are you seeing in the Service Center error logs?

Thanks,

Justin


Hi Justin,

It is asking me to refresh the dependenies, I did but it showed the following errors



and I am getting below errors in Service Center.

You are missing a dependency. Do you have the following dependencies installed in your environment:

Justin Babel wrote:

You are missing a dependency. Do you have the following dependencies installed in your environment:


Hi,

I don't have those dependencies. I will download them right now.

trinusha karumanchi wrote:

Justin Babel wrote:

You are missing a dependency. Do you have the following dependencies installed in your environment:


Hi,

I don't have those dependencies. I will download them right now.


Hi, 

I can see the output right now, Can you expalin the functionality of the top table. I understood the functionality of below table.

EDIT: What kind of sorting is that, Is it multiple column sorting.


Hi Trinusha,

Please look at the web block input parameters in the demo module, and read all the descriptions on each input parameter and if you have any doubts, post another thread in the support section of the component:

https://www.outsystems.com/forge/component-discussions/1789/DragTable

Thanks,

Justin

Justin Babel wrote:

Hi Trinusha,

Please look at the web block input parameters in the demo module, and read all the descriptions on each input parameter and if you have any doubts, post another thread in the support section of the component:

https://www.outsystems.com/forge/component-discussions/1789/DragTable

Thanks,

Justin


Thank you, I will get back to you. I will post another thread in support section of the forum.

Regards,

Trinusha.