SearchBuilder inside editor modal in an input field of type "datatable"

SearchBuilder inside editor modal in an input field of type "datatable"

EmadoEmado Posts: 3Questions: 1Answers: 0

Hello everyone,

How can I search inside the datatable inside my modal (the input field with type datatable)?

    const editor = new DataTable.Editor({
        ajax: '/data-tables/stock-check',
        fields: [
            {
                label: 'Name:',
                name: 'stock_check_list.name'
            },
            {
                label: 'Items:',
                name: 'items_data[].ItemId',
                type: 'datatable',
                multiple: true,
                optionsPair: {
                    value: 'ItemId'
                },
                config: {
                    columns: [
                        {
                            title: 'ItemId',
                            data: 'ItemId'
                        },
                        {
                            title: 'Description',
                            data: 'Description'
                        },
                        {
                            title: 'InventoryLocation',
                            data: 'InventoryLocation'
                        },
                        {
                            title: 'InventoryBalance',
                            data: 'InventoryBalance'
                        },
                        {
                            title: 'LatestInventoryDate',
                            data: 'LatestInventoryDate'
                        },
                        {
                            title: 'TotalValue',
                            data: "null",
                            render: (data, type, row) => {
                                return row.InternalOrderPrice * row.InventoryBalance
                            }
                        },
                    ]
                }
            }
        ],
        table: tableElement
    });

Answers

  • allanallan Posts: 63,676Questions: 1Answers: 10,497 Site admin

    I've never tried it, the default global search has been enough for the majority of the use cases I've seen, but you could specify a layout object in your config object:

    layout: {
      top1: 'searchBuilder',
      top: ['search', 'buttons', info'],
      button: 'paging'
    }
    

    For example. You might need to customise it to suit your needs.

    Allan

  • EmadoEmado Posts: 3Questions: 1Answers: 0

    Thank you for your fast reply.

    But it didn't work :smile:

  • EmadoEmado Posts: 3Questions: 1Answers: 0

    Update:
    The dom option worked.
    dom: 'Qftip',

Sign In or Register to comment.