3月21

kendoGrid获取选中的行

| |
13:43Web开发  From: 本站原创
                      var grid = $("#grid").kendoGrid({
                                            dataSource: dataSource,
                                            resizable: true,
                                            scrollable: true,
                                            navigatable: false,
                                            rownumber: true,
                                            selectable: 'multiple, rowbox',
                                            dataBound: function () {
                                                if (parent.autoResizeIframe) {
                                                    parent.autoResizeIframe('${RequestParameters.functionCode!}')
                                                }
                                            },
                                            columns: [

                                                {
                                                    field: "name",
                                                    title: '<@spring.message "物料名称"/>',
                                                    width: 80
                                                },
                                                {
                                                    field: "spc",
                                                    title: '<@spring.message "规格"/>',
                                                    width: 80
                                                },
                                                {
                                                    field: "num",
                                                    title: '<@spring.message "计划量"/>',
                                                    width: 60,
                                                    required: true
                                                },
                                                {
                                                    field: "unitCode",
                                                    title: '<@spring.message "单位"/>',
                                                    width: 60
                                                },
                                                {
                                                    field: "prdNoSup",
                                                    title: '<@spring.message "货号"/>',
                                                    width: 80
                                                },
                                                {
                                                    field: "planMoney",
                                                    title: "计划单价",
                                                    width: 80,
                                                    format: "{0:c}",
                                                },
                                                {
                                                    field: "startingPrice",
                                                    title: "起拍价",
                                                    width: 80,
                                                    format: "{0:c}",
                                                },
                                                {
                                                    field: "minPriceCut",
                                                    title: "最低降价幅度",
                                                    width: 120,
                                                    format: "{0:c}",
                                                },
                                                {
                                                    field: "productId",
                                                    title: '<@spring.message "ERP物料名称"/>',
                                                    width: 80,
                                                    hidden: true,
                                                },
                                                {
                                                    field: "purcNo",
                                                    title: 'ERP物料编码',
                                                    width: 120,
                                                    editor: function (container, options) {
                                                        $('<input name="' + options.field + '"/>')
                                                            .appendTo(container)
                                                            .kendoLov($.extend(<@lov"LOV_SELECT_PRODUCT"/>, {
                                                            textField: 'prdNo',
                                                            model: options.model,
                                                            select: function (e) {
                                                                options.model.set('purcNo', e.item.prdNo)
                                                                options.model.set('productId', e.item.productId)
                                                                options.model.set('proName', e.item.name)
                                                                options.model.set('proUnitCode', e.item.unitCode)
                                                                options.model.set('currentMoney', e.item.currentMoney)
                                                            }
                                                        }
                                                    ));
                                                    }
                                                },
                                                {
                                                    field: "proName",
                                                    title: '<@spring.message "ERP物料名称"/>',
                                                    width: 100
                                                },
                                                {
                                                    field: "proUnitCode",
                                                    title: '<@spring.message "ERP主单位"/>',
                                                    width: 120
                                                },
                                                {
                                                    field: "currentMoney",
                                                    title: '<@spring.message "最新价格"/>',
                                                    width: 80
                                                },
                                            ],
                                            editable: true
                                        }).data('kendoGrid');  
以下是获取当前选中行的方法,在网上找了很多个都不管用,还是使用以下方法新测可用
         var grid =$("#grid").data('kendoGrid');
            var items = grid.selectedDataItems();

来源:Heck's Blog
地址:https://www.heckjj.com/post/588/
转载时须以链接形式注明作者和原始出处及本声明,否则将追究法律责任,谢谢配合!
阅读(1298) | 评论(0) | 引用(0)