Coder Social home page Coder Social logo

Comments (8)

komarovalexander avatar komarovalexander commented on July 22, 2024 1

Great idea, I have it in my roadmap, will try to implement it in a week. I will keep you updated

from ka-table.

komarovalexander avatar komarovalexander commented on July 22, 2024 1

Hi @C0casio45 search bar has been added in v11.0.0
Demo: https://komarovalexander.github.io/ka-table/#/header-filter-logic

image

from ka-table.

C0casio45 avatar C0casio45 commented on July 22, 2024

Hey, thanks a lot
I have some questions
First in your example, the only filterable score is 33, is it supposed to work like this ?
Also, there is a way to cutomize the key passed to the underneath table ? (or getting a random one)

from ka-table.

komarovalexander avatar komarovalexander commented on July 22, 2024

First in your example, the only filterable score is 33, is it supposed to work like this ?

sorry did not get the question

Also, there is a way to cutomize the key passed to the underneath table ? (or getting a random one)

what purpose?

from ka-table.

C0casio45 avatar C0casio45 commented on July 22, 2024

First in your example, the only filterable score is 33, is it supposed to work like this ?

My bad for this one I didn't get that 33 was already typed ...

Also, there is a way to cutomize the key passed to the underneath table ? (or getting a random one)

I am passing an object to it and getting this error

Warning: Encountered two children with the same key, `[object Object]`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
   at Rows (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:3704:35)
   at VirtualizedRows (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:3819:24)
   at TableBodyContent (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:3882:35)
   at tbody
   at TableBody (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:3952:35)
   at table
   at div
   at TableWrapper (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:5056:22)
   at div
   at TableControlled (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:5153:35)
   at TableUncontrolled (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:5260:21)
   at Table (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:913:28)
   at HeaderFilterPopupContent (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:1596:26)
   at div
   at div
   at HeaderFilterPopup (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:1766:26)
   at div
   at TableControlled (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:5153:35)
   at TableUncontrolled (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:5260:21)
   at Table (http://localhost:3000/node_modules/.vite/deps/chunk-MVUGCKE5.js?v=526fafc0:913:28)

I also mentionned that large playload of headers are not rendered with virtualization, is it intendeed ?

from ka-table.

komarovalexander avatar komarovalexander commented on July 22, 2024

Can you share the link to example with the error on stackblitz https://stackblitz.com/edit/table-header-filter-logic-ts?file=Demo.tsx ?

from ka-table.

C0casio45 avatar C0casio45 commented on July 22, 2024

I have no access to satckblitz here, it's blocked by the company policies...

This is my column

{ 
    key: "componentSoftwareVersions",
    title: "Software Versions", 
    dataType: DataType.Object, 
    visible: true, 
    headerFilterListItems: softwareVersionsFilterListItems, 
    filter: (value, filterValue) => 
      filterValue?.some((x: any) => 
        value.some(((v: any) => v.id === x.id))), 
    isHeaderFilterSearchable: true, 
    headerFilterSearch: (value, searchValue) => 
      value.softwareVersion.software.name.toLowerCase().includes(searchValue.toLowerCase())
  },

This is the case in the format property of the Table

          case "componentSoftwareVersions":
            return value?.map((v: any) => v.softwareVersion.software.name + " " + v.softwareVersion.version).join(", ") ?? "∅";

This is part of the childComponent property of the Table

        headerFilterPopupTextCell: {
          content: ({ value }) => {
            if(value.employee) return value.employee.fullName
            if(value.softwareVersion) return value.softwareVersion.software.name + " " + value.softwareVersion.version
            return value.name
          }
        }

This is an example of the object itself

{
  id: "AAA-123",
  componentSoftwareVersions: [
    {id: "6977"
    softwareVersion: {
          id: "2"
       software: {
          name: "React"
       }
       version: "18.3.1"}},
    {id: "6978"
    softwareVersion: {
          id: "1"
       software: {
          name: "Vitejs"
       }
       version: "5.3.0"}},
  ]
}

I also checked that all my componentSoftwareVersions.id

from ka-table.

komarovalexander avatar komarovalexander commented on July 22, 2024

headerFilterListItems is a function which should return array of strings.
Check demo https://komarovalexander.github.io/ka-table/#/header-filter-logic

And docs: https://ka-table.com/docs_props.html#toc1

from ka-table.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.