Atividades de "nurul.talukder"

Hi Alper I have successfully added the Actions button in each row while creating new entries. Here is the code i am using:

var table = $('#selectedQualTable').DataTable({
        processing: true,
        paging: true,
        searching: false,
        scrollX: true,
        autoWidth: true,
        scrollCollapse: true,
        select: "single",
        "columns": [
            {
                title: l('Actions'),
                "defaultContent": "",
                rowAction: {
                    items:
                        [
                            {
                                text: l('Edit'),
                                action: function (data) {
                                    //TODO: Open a modal to edit the book
                                }
                            },
                            {
                                text: l('Delete'),
                                action: function (data) {
                                    // Actions for Delete
                                }
                            }
                        ]
                }
            },
            {
                "title": "Type",
                "data": "Type"
            },
            {
                "title": "Code",
                "data": "Code"
            },
            {
                "title": "Name",
                "data": "Name"
            },
            {
                "title": "Version",
                "data": "Version"               
            },
            {
                "title": l("HowToAchieve"),
                "data": "HowToAchieve"                
            }
    ],
        "order": [[1, 'asc']]
    });
    
    //code for filling up the row and add to Datatable
    achievementRegisterService.getWithNavigationProperties($achievementRegId)
            .then(function (result) {

                table.row.add({
                    "Type": result.achievementType.name,
                    "Code": result.achievementRegister.code,
                    "Name": result.achievementRegister.name,
                    "Version": $version,
                    "HowToAchieve": $howToAchieve
                }).draw(false);
            });

By the way, I am trying to render two Select2 dropdowns in the 'Version' and 'HowToAchieve' column. and will load the available versions and howToAchieve options while creating new row. Any idea or sample code for that would be appreciated.

Thanks again for your help!

hi

You can try this https://stackoverflow.com/questions/55215216/datatables-row-add-based-on-columns?answertab=active#tab-top

If you still can't solve your problem, you can send me a simple project. liming.ma@volosoft.com

I am half successful to add a button in the row but still could not figure out how to add the Action Column using ColumnDef. I will share a sample project soon.

Thanks for your support.

Hi I tried to do that as well, but no luck. May be I am not doing it correctly. Here is the code I tried earlier:

` var qualListTable = $("#programmeQualificationTable").DataTable(
        {
            processing: true,
            //serverSide: true,
            paging: true,
            //searching: false,
            scrollY: '50vh',
            autoWidth: true,
            scrollCollapse: true,
            columnDefs: [
                {
                    title: l('Actions'),
                    rowAction: {
                        items:
                            [
                                {
                                    text: l('Delete'),
                                    action: function (data) {
                                        ///...
                                    }
                                }
                            ]
                    },

                },
                {
                    title: l("Type")
                },
                {
                    title: l('Code')
                },
                {
                    title: l('Name')
                },
                {
                    title: l('Version')
                }
            ]
        }
    );`

If Possible please share an example.

Mostrando 11 até 13 de 13 registros
Made with ❤️ on ABP v8.2.0-preview Updated on março 25, 2024, 15:11