No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. rund1me
    3. Topics
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 15
    • Best 1
    • Groups 0

    Topics created by rund1me

    • R

      Select unusable with a lot of data
      Framework • • rund1me

      8
      0
      Votes
      8
      Posts
      914
      Views

      metalsadman

      @rstoenescu that’s good to hear :).

    • R

      Q-table Slow conditional rendering
      Framework • • rund1me

      12
      0
      Votes
      12
      Posts
      2196
      Views

      K

      I also struggled with many components inside QTable. I replaced them using native html with quasar css:

      <button tabindex=“0” type=“button” class=“q-btn inline relative-position q-btn-item non-selectable q-btn-rectangle q-focusable q-hoverable bg-white text-black”><div class=“q-focus-helper”></div><div class=“q-btn-inner row col items-center justify-center”><div>Standard</div></div></button>

      This is not good long term solution but I agree that we need some functional components built in into framework - for exapmle: QBtnSimple, QIconSimple etc… This way we can avoid that future change inside framework css will break my native button styled using quasar css. I will create feature request for that using Github. Not everyone knows at the beginning why some components work so slowly using sub components.

    • R

      q-table selection shows y-scrollbar
      Framework • • rund1me

      3
      0
      Votes
      3
      Posts
      890
      Views

      R

      Thanks that worked!

    • R

      Quasar Table Jump to page
      Help • • rund1me

      6
      0
      Votes
      6
      Posts
      764
      Views

      R

      i have done the following now:
      I have overwritten the default sort (actually with the same code as the default table sort) and added the __sortedIndex:

      tableSort (data, sortBy, descending) { const col = this.columns.find(def => def.name === sortBy) if (col === null || col.field === void 0) { let sortedStuff = data.slice().map((row, i) => { row.__sortedIndex = i return row }) return sortedStuff } const dir = descending ? -1 : 1, val = typeof col.field === 'function' ? v => col.field(v) : v => v[col.field] let sorted = data.sort((a, b) => { let A = val(a), B = val(b) if (A === null || A === void 0) { return -1 * dir } if (B === null || B === void 0) { return 1 * dir } if (col.sort) { return col.sort(A, B) * dir } if (isNumber(A) && isNumber(B)) { return (A - B) * dir } if (isDate(A) && isDate(B)) { return sortDate(A, B) * dir } if (typeof A === 'boolean' && typeof B === 'boolean') { return (a - b) * dir } [A, B] = [A, B].map(s => (s + '').toLowerCase()) return A < B ? -1 * dir : A === B ? 0 : dir }) let sortedStuff = sorted.slice().map((row, i) => { row.__sortedIndex = i return row }) return sortedStuff }

      It would be nice to have a callback after sorting is done so we can add the __sortedIndex in this case so its not necessary to re-code the default sorting.
      also i am watching the selected rows change, and the pagination object change and select the page in the pagination object. this is done by using the default __index if not sorted and if available the __sortedIndex:

      selectedRows (what) { if (what.length > 0) { let idx = what[0].__index + 1 if (what[0].__sortedIndex) { idx = what[0].__sortedIndex + 1 } let newPage = idx / this.paginationControl.rowsPerPage this.paginationControl.page = Math.ceil(newPage) } else { this.paginationControl.page = 1 } }

      It somehow works even with filtering, what i dont understand.
      do you have any better solution to this or do you see any problems here?

      Thanks for the help and Cheers!