diegodesouza
Repos
118
Followers
44
Following
138

Events

issue comment
Table - select up to 10 when selectable is true

Using react-table instead

Created at 13 hours ago
Table - select up to 10 when selectable is true

❓Question

From this example i know it's possible to have a limit on how many rows an user can select.

https://codesandbox.io/s/priceless-shaw-7fmyx?file=/src/App.js

but i don't have access to rows from the useTableContext you export. Is there anyway to implement a max allowed to select using your table? or should I use tanstack table directly?

Created at 13 hours ago
Table - select up to 10 when selectable is true

❓Question

From this example i know it's possible to have a limit on how many rows an user can select.

https://codesandbox.io/s/priceless-shaw-7fmyx?file=/src/App.js

but i don't have access to rows from the useTableContext you export. Is there anyway to implement a max allowed to select using your table? or should I use tanstack table directly?

Created at 16 hours ago
pull request opened
feat: add redo icon
Created at 1 week ago
diegodesouza create branch feat/add-redo-icon
Created at 1 week ago
AvOrganizationSelect - defaultToOnlyOption won't work with getResult

🐛 Bug report

Current Behavior

If getResult() is used, then defaultToOnlyOption never gets selected.

Expected behavior

Be able to get the selected/ default option when defaultToOnlyOption is true using getResult().

Created at 2 weeks ago
issue comment
AvOrganizationSelect - defaultToOnlyOption won't work with getResult

I missed that the return value for the getResult callback has to be an array. Working as expected

Created at 2 weeks ago
AvOrganizationSelect - defaultToOnlyOption won't work with getResult

🐛 Bug report

Current Behavior

If getResult() is used, then defaultToOnlyOption never gets selected.

Expected behavior

Be able to get the selected/ default option when defaultToOnlyOption is true using getResult().

Created at 2 weeks ago
React Table - Change itemsPerPage

❓Question

https://availity.github.io/availity-react/components/table/tableControls

What's the best way of setting itemsPerPage when doing something like

    <Table
      initialState={{}}
      columns={isProviderTable ? providerColumns : columns}
      data={data}
      selectable={isProviderTable}
      sortable={isProviderTable}
      paged={isProviderTable}
      onRowSelected = {(event) => {
        if (event && event.selectedRows.length > 0) {
          setSelectedRows(event.selectedRows)
        }
      }}
    >
      <TableControls>
        <TableContent />
        <div style={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
          <TableContext.Consumer>
            {({ instance }) => {
              console.log(instance);
              return (
                <Pagination
                  // itemsPerPage={instance.setPageSize(6)}
                  // itemsPerPage={6}
                  itemsPerPage={instance.state. pageSize}
                  page={instance.currentPage}
                  onPageChange={(page) => {
                    const { gotoPage } = instance;
                    gotoPage(page - 1);
                  }}
                  items={isProviderTable ? selectedUsers : preferences.preferences}
                >
                  <PaginationControls
                    className="pt-3"
                    // listClassName="pagination"
                    directionLinks
                    // showPaginationText
                    pageRange={3}
                    marginPages={1}
                  />
                </Pagination>
              )}}
          </TableContext.Consumer>
        </div>
      </TableControls>
    </Table>

Created at 4 weeks ago
issue comment
React Table - Change itemsPerPage

for future reference

  if (instance.state.pageSize !== resultPerPage) {
    setTimeout(() => {
      instance.setPageSize(resultPerPage)
    }, 500)
  }
}
Created at 4 weeks ago
React Table - onRowSelected() being called multiple times with selectable option

🐛 Bug report

Current Behavior

When using <Table selectable onRowSelected={(e) => console.log(e)}></Table> the onRowSelected() gets called multiple times

Expected behavior

I would like to know how to have it call my callback function only once.

Reproducible example

https://stackblitz.com/edit/react-qbhltv?file=TableComponent.js

Created at 4 weeks ago
issue comment
React Table - onRowSelected() being called multiple times with selectable option

Closing as the issue is not with

Created at 4 weeks ago
issue comment
React Table - Change itemsPerPage

If i use the instance.setPageSize(6) withing the <Pagination></Pagination> like the example above, or before the return, the app gets into an infinite loop. FYI

Created at 1 month ago
React Table - Change itemsPerPage

❓Question

https://availity.github.io/availity-react/components/table/tableControls

What's the best way of setting itemsPerPage when doing something like

    <Table
      initialState={{}}
      columns={isProviderTable ? providerColumns : columns}
      data={data}
      selectable={isProviderTable}
      sortable={isProviderTable}
      paged={isProviderTable}
      onRowSelected = {(event) => {
        if (event && event.selectedRows.length > 0) {
          setSelectedRows(event.selectedRows)
        }
      }}
    >
      <TableControls>
        <TableContent />
        <div style={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
          <TableContext.Consumer>
            {({ instance }) => {
              console.log(instance);
              return (
                <Pagination
                  // itemsPerPage={instance.setPageSize(6)}
                  // itemsPerPage={6}
                  itemsPerPage={instance.state. pageSize}
                  page={instance.currentPage}
                  onPageChange={(page) => {
                    const { gotoPage } = instance;
                    gotoPage(page - 1);
                  }}
                  items={isProviderTable ? selectedUsers : preferences.preferences}
                >
                  <PaginationControls
                    className="pt-3"
                    // listClassName="pagination"
                    directionLinks
                    // showPaginationText
                    pageRange={3}
                    marginPages={1}
                  />
                </Pagination>
              )}}
          </TableContext.Consumer>
        </div>
      </TableControls>
    </Table>

Created at 1 month ago
issue comment
@availity/reactstrap-validation-select loadOptions

Are you getting anything back from this.loadOptions? aside from the loadOptions not setting a default value?

Created at 1 month ago
React Table - onRowSelected() being called multiple times with selectable option

🐛 Bug report

Current Behavior

When using <Table selectable onRowSelected={(e) => console.log(e)}></Table> the onRowSelected() gets called multiple times

Expected behavior

I would like to know how to have it call my callback function only once.

Reproducible example

https://stackblitz.com/edit/react-qbhltv?file=TableComponent.js

Created at 1 month ago
Created at 1 month ago
started
Created at 1 month ago
Created at 1 month ago
Created at 1 month ago
Created at 1 month ago
Created at 1 month ago
Created at 2 months ago
Created at 2 months ago