Open Closed

Using rowCallback conflicts with rowAction at abp datatable #3040


User avatar
0
Dina created

Hi,

I m using an abp datatable in which i have rowActions for 2 buttons

it works normally, but when i added a rowCallback to the table (to make some rows with different color with specific condition) it makes the rowActions ignored for the 2 buttons, and they become invisible!!

so the rows are colored correctly, but there are no columns for the action items.

Please i want to fix this issue ASAP to use rowcallback normally with rowactions.

Thanks in advance


10 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you add a breakpoint and check this?

    https://github.com/abpframework/abp/blob/ce10de025ecb04512da86a15e585234bbc2fb07c/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js#L267

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    https://support.abp.io/QA/Questions/3040#answer-b59f67c9-1737-02db-e114-3a03c3ebf134

  • User Avatar
    0
    Dina created

    i need a clarification, what should be modified at my datatable?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, I will share some code, Please wait a moment.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    _dataTable = _$table.DataTable(
        abp.libs.datatables.normalizeConfiguration({
            order: [[1, 'asc']],
            processing: true,
            serverSide: true,
            scrollX: true,
            paging: true,
            ajax: abp.libs.datatables.createAjax(
                _identityUserAppService.getList
            ),
            columnDefs: abp.ui.extensions.tableColumns.get('identity.user').columns.toArray(),
            rowCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
                $.fn.dataTable.defaults.fnRowCallback.apply(this, [nRow, aData, iDisplayIndex, iDisplayIndexFull]);
            }
        })
    );
    
  • User Avatar
    0
    Dina created

    it worked, thanks!

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You're welcome.

  • User Avatar
    0
    Dicky.tech@gmail.com created

    Any sample for database footer with totals ?

  • User Avatar
    0
    Dicky.tech@gmail.com created

    Copy tenant data to a new tenant. This helps when you want to create a copy of an existing tenant to do some tests

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Any sample for database footer with totals ?

    The API has totalCount response. You can add it by yourself.

    https://datatables.net/examples/advanced_init/footer_callback.html

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38