Hi,
Is there a way to get the current sort 'status' of a table?
I have a table with some columns set to 'sortable'. Users use this to find records they have to work on. When the table is updated, the table goes back to it's default sortation. So the user has to 'search' again for the record's it has to work on.
Of course I can restore the table sorting after the update with tables.tableName.sort(columns, directions) but to do be able to do this, I need to get the columns and directions the user selected.
Is there a way to get these?
Regards,
David
getting current table sort status
Moderators: Jon, Steve, Ian, Dave
- dvanhussel
- Ebase User
- Posts: 161
- Joined: Fri Oct 19, 2007 12:45 pm
- Location: Haarlem, the Netherlands
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
- dvanhussel
- Ebase User
- Posts: 161
- Joined: Fri Oct 19, 2007 12:45 pm
- Location: Haarlem, the Netherlands
Hi Jon,
Sorry, I made a mistake in my first post about this. On updateTable() the sorting is indeed preserved.
But, in order to get any new records that where added while the form is used, a fetchTable() command is issued. This resets the sorting. Is this supposed to work this way or not? (I'm using the second V5 beta)
The icon that shows the column order, after being changed by the user does not change after fetching the data. This seems to indicate that the tablerows are still sorted by that column, but they are not.
Regards,
David
Sorry, I made a mistake in my first post about this. On updateTable() the sorting is indeed preserved.
But, in order to get any new records that where added while the form is used, a fetchTable() command is issued. This resets the sorting. Is this supposed to work this way or not? (I'm using the second V5 beta)
The icon that shows the column order, after being changed by the user does not change after fetching the data. This seems to indicate that the tablerows are still sorted by that column, but they are not.
Regards,
David
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
David,
Fetchtable resets everything including including any column sorts. It's a bug that the sort indicators aren't reset, I'll get this investigated. It's not quite clear to me why you need to re-issue a fetchtable - are you adding data to the table directly i.e. not using insertrow() on the table?
Regards
Jon
Fetchtable resets everything including including any column sorts. It's a bug that the sort indicators aren't reset, I'll get this investigated. It's not quite clear to me why you need to re-issue a fetchtable - are you adding data to the table directly i.e. not using insertrow() on the table?
Regards
Jon
0 x
- dvanhussel
- Ebase User
- Posts: 161
- Joined: Fri Oct 19, 2007 12:45 pm
- Location: Haarlem, the Netherlands
Jon,
This is for a system in which multiple users have access to records of their department. When the form is started, data is fetched from the database. The user searches for records to work on (newest, oldest, a specific category etcetera) by sorting the data in the table.
Then the user opens one of the records. After finishing working on this, the user goes back to the table (preferably sorted the way it was).
In the mean time data could have been added (by an other user or an integration resource in this project). I would like to update the table to contain these new records. These records are inserted with insertrow() but not in the formsession the user is in.
Is there a better way to do this?
Ofcourse, I could add some buttons to do the sorting in javascript, and then, after a fetchtable() reapply the sorting. But I would rather use the default Ebase functionality for this.
Regards,
David
This is for a system in which multiple users have access to records of their department. When the form is started, data is fetched from the database. The user searches for records to work on (newest, oldest, a specific category etcetera) by sorting the data in the table.
Then the user opens one of the records. After finishing working on this, the user goes back to the table (preferably sorted the way it was).
In the mean time data could have been added (by an other user or an integration resource in this project). I would like to update the table to contain these new records. These records are inserted with insertrow() but not in the formsession the user is in.
Is there a better way to do this?
Ofcourse, I could add some buttons to do the sorting in javascript, and then, after a fetchtable() reapply the sorting. But I would rather use the default Ebase functionality for this.
Regards,
David
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Who is online
Users browsing this forum: No registered users and 10 guests