Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-67914

Update table_sql to support dynamic sorting

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Setup
      • You will need a course with some users enrolled.
      Testing.
      1. Log in as admin and go to the course.
      2. Click Participants on the nav drawer.
      3. On the participants table note some table headers are links.
      4. Click on the links (First name, Surname..)
      5. Make sure the participants are sorted and the content is refreshed without reload the page.
      6. Try other columns, click Email address and make sure the participants get sorted and the content is refreshed without reloading.
      Show
      Setup You will need a course with some users enrolled. Testing. Log in as admin and go to the course. Click Participants on the nav drawer. On the participants table note some table headers are links. Click on the links (First name, Surname..) Make sure the participants are sorted and the content is refreshed without reload the page. Try other columns, click Email address and make sure the participants get sorted and the content is refreshed without reloading.
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-67914-master
    • Story Points:
      5
    • Sprint:
      International 3.9 - Sprint 8

      Description

      This is the first logical step after moving table_sql to have a generic web service.

      This is likely the smallest possible change that we can make

      We will need to:

      1. add new arguments to the web service:
        1. sortby (string) A string describing the name of a sortable column
        2. sortdir (int) The sort direction to use when sorting that column
      2. write a new set of AMD modules to handle capture of the sorting
      3. update our output of the table to instantiate our new JS

      JS

      Root path: lib/table/amd/src
      General structure:

      dynamic.js
      local/dynamic/repository.js
      local/dynamic/selectors.js
      local/dynamic/events.js
      

      Need to create a setup() function which listens on the outer-most element for the table (ideally a new <div> which the table is placed in.
      We can keep any arguments in data-attributes on that div
      We look for any clicks on any of the sort buttons and intercept
      Call the WS and replace the <table> tag with the new one

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lameze Simey Lameze
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Andrew Nicols
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/20

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 days, 3 hours, 42 minutes
                  4d 3h 42m