Okay
  Public Ticket #2790502
Disable sorting on load
Closed

Comments

  • Andrew started the conversation

    Hello,

    I'm trying to display a table which isn't sorted by any column on loading (i.e. have it displayed as it is in Excel), but which is then sortable by the users. 

    Disabling sorting on loading is easy by unchecking the 'Allowing sorting for the table' option, but then sorting on all columns is disabled for the users. 

    I'd like to have it so there's no sorting on load, but users are then able to sort columns themselves. 

    Is this possible? If so, does anyone know how?

  • [deleted] replied

    Hi Andrew

    Thank you for reaching out to us.

    You can leave the Allow sorting option enabled and simply disable Use as default sorting column, this will allow users to individually sort columns if they like but the column will not be used to sort values on load.

    5273837849.png

    I hope this helps, do let us know if you need any further assistance.

  • Andrew replied

    Hi Blaženka,

    Thank you for getting back to me.

    I've just tried your solution, but it looks like if there are no columns selected as the default sorting column, it sorts by the first column on load. 

    Any other ideas?

    Thanks,

    Andrew

  • [deleted] replied

    Hey Andrew

    That should not be the case, once you create the table it will be loaded in the order the entries were added, and that can be changed either by setting a specific column to sort by on load, or manually sorting the column by clicking on the title. 

    But you can also set wdt_ID to be the column to be sorted by on load since it is hidden and all entries will be displayed exactly in the order they were added (if you set the sorting order to ascending of course).

    9227316259.png

    I hope this helps, do let us know if you know any further assistance.

  • Andrew replied

    Hi Blaženka,

    Thanks again for your reply. 

    I've attached a few screenshots to show how the sorted on load is appearing. 

    Screenshot 1 shows the data as I want it to be loaded (i.e. by the way it is in Excel), which works fine with 'Allow sorting for the table' unchecked.

    Screenshot 2 shows what happens after checking the box - it is now sorted by A-Z on the 'Description' column - and screenshot 3 shows that this column has 'Sort this table by column on load' unchecked.

    Your second solution sounds good, but I'm afraid I can't see the 'wdt_ID' appearing in the column list - is there something I need to do to be able to see this column?

    Thanks,

    Andrew

  • [deleted] replied

    Hey Andrew

    Please provide me a temporary WP-admin (administrator) user for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. 

    We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties. 

    You can write credentials here just check PRIVATE Reply so nobody can see them except us.


  •   Andrew replied privately
  • [deleted] replied

    Hi Andrew

    I apologize I haven't realized this is a table linked to an existing source.

    You would need to turn off sorting for the table, and then create a custom JavaScript that would allow sorting of the table. 

    You can suggest this option as a feature for a future update by leaving your suggestion following this link and it will go straight to our developers.

  • Andrew replied

    Hi Blaženka,

    Thanks for looking into it, that's a shame it doesn't work for tables linked to existing data sources. 

    Thanks for providing that link, I'll leave it as a suggestion for the future. 

    Thanks,

    Andrew

  • [deleted] replied

    You are most welcome, I wish I could be more helpful.

    If there is anything else we can assist you with please don't hesitate to contact us.

    Have a wonderful day!

  • Andrew replied

    Hi Blaženka, 

    There is just one more thing I wanted to ask before I pull the trigger and purchase the premium version. 

    You've now seen datasets, which contain salaries by percentile. 

    What I'd like to happen is for the user to be able to enter a number (a salary) into a search box on the webpage, which would then query the wpdatatables data, and the user would then receive a result along the lines of 'Your salary is between the 80th and 90th percentile', for example. 

    Is there a way for users to query data uploaded into wpdatatables this way?

    Thanks,

    Andrew

  • [deleted] replied

    Hey Andrew

    I am not sure I understand your setup, could you provide us with some examples of what you would like to achieve?

    You are able to search the data in the table using our search box but it will bring out only the results that match the search criteria and no message is displayed while doing that.

  • Andrew replied

    Hi Blaženka,

    Sure, I've attached a screenshot of a table I'm currently using.

    I'd like for a user to be able to enter their salary/age into a search box on the page, and for it to return in which percentile they lie. For example, if I entered a salary of £20,000 and an age of 35, the result would be that I'm between the 10th and 20th percentile. 

    Does that make sense?

    This may require the use of a third party plugin to integrate with the uploaded data, and if that's the case, do you have any idea which plugin it'd be best to use?

    Thanks,

    Andrew


  • [deleted] replied

    Hi Andrew

    Unfortunately this is not possible using the plugin's builtin features and to be honest I really can't think of a third party plugin that would help accomplish this.

    Again, you will be able to use the search functions of the table but the results can't be customized.