【问题标题】:Traverse checkboxes in an ejGrid遍历 ejGrid 中的复选框
【发布时间】:2022-01-20 17:45:56
【问题描述】:

我有一个带有复选框的网格。我试图弄清楚当单击按钮时如何遍历网格以查看选中了哪些复选框。

网格:

    $("#dataGrid").ejGrid({
        dataSource: dataManager,
        allowSelection: false,
        allowFiltering: true,
        allowTextWrap: true,
        allowPaging: true,
        filterSettings: {
            filterType: "excel"
        },
        allowSorting: true,
        toolbarSettings: { showToolbar: true, toolbarItems: ["search"] },
        allowSearching: true,
        columns: [
            { type: 'checkbox', width: 50 },
            { field: "Id", visible: false },
            { field: "RegistarName", headerText: "Registrar" },
            { field: "VoterStatus", headerText: "Voter Status" },
            { field: "strTrainedDate", headerText: "Trained" },
            { field: "strOathDate", headerText: "Oath" },
            { field: "Term", headerText: "Term" },
            { field: "OrganizationTypeName", headerText: "Organization Type" },
            { field: "RegistrarOrganizationName", headerText: "Organization" },
            {
                headerText: "",
                template: '<a href="#" onclick="Edit({{:Id}})">Edit</a>',
                width: 75,
                textAlign: "center"
            },
            {
                headerText: "",
                template: '<a href="#" data-url="@Url.Action("Delete")/{{:Id}}" data-name="{{:RegistarName}}" data-toggle="modal" data-target="#confirmModal">Delete</a>',
                width: 75,
                textAlign: "center"
            },
        ]
    });

【问题讨论】:

    标签: jquery grid syncfusion


    【解决方案1】:

    我们已经在我们的 Syncfusion 知识库中讨论了“如何在多复选框功能中从所有页面中获取选定记录”。参考知识库链接: https://www.syncfusion.com/kb/7624/how-to-get-selected-records-from-all-page-in-multi-checkbox-feature

    否则在外部按钮点击时,我们可以通过Grid的getSelectedRecords方法获取对应的选中/选中记录。
    API链接:https://help.syncfusion.com/api/js/ejgrid#methods:getselectedrecords

    【讨论】:

    • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效。
    猜你喜欢
    • 1970-01-01
    • 2011-12-21
    • 1970-01-01
    • 2011-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-20
    相关资源
    最近更新 更多