FineUI 官方论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

本论坛已关闭(禁止注册、发帖和回复)
请移步 三石和他的朋友们

FineUI首页 WebForms - MVC & Core - JavaScript 常见问题 - QQ群 - 十周年征文活动

FineUI(开源版) 下载源代码 - 下载空项目 - 获取ExtJS - 文档 在线示例 - 版本更新 - 捐赠作者 - 教程

升级到 ASP.NET Core 3.1,快、快、快! 全新ASP.NET Core,比WebForms还简单! 欢迎加入【三石和他的朋友们】(基础版下载)

搜索
查看: 4385|回复: 3
打印 上一主题 下一主题

Grid怎么数据库排序

[复制链接]
跳转到指定楼层
楼主
发表于 2018-3-1 22:07:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
sorting: true,
databaseSorting: true,

启用了排序,但字段的排序功能还是灰色的.
沙发
 楼主| 发表于 2018-3-1 22:23:29 | 只看该作者
F.ui({
                        type: 'grid', id: 'grid1', renderTo: '#wrap1', width: 700, collapsible: true, title: '表格',
                        //sorting: true,//排序
                        //databaseSorting: true,
                        //sortField: "djxh",
                        //sortDirection: "DESC",
                        
                        paging: true,        //是否启用分页
                        databasePaging: true,         //是否数据库分页
                        
                        pageSize: 5,             //每页显示记录数
                        
                        //summary: false,        //显示合计行
                        
                        columnMoving: true,        //是否启用列移动          
                        
                        idField: 'id',
                        textField: 'name',
                        fields: ["djxh", "dh", "djlx", "khbh", "khmc"],                        
                        columns: [
                                {columnType: 'rownumberfield'},           //序号                     
                                {text: '单据型号', field: 'djxh', width: 100},
                                {text: '单号', field: 'dh', width: 150},
                                {text: '单据类型', field: 'djlx', width: 100},
                                {text: '客户编号', field: 'khbh', width: 100},
                                {text: '客户名称', field: 'khmc', width: 200}
                        ],
                        //data: DATA,
                        //dataUrl: "/findAllWpdj",        //网址数据源
                        //dataMethod: "POST",        //请求网址数据源的方法
                         listeners: {
                                 paging: function (event, pageIndex) {
                                            //console.log(event);
                                        this.setPageIndex(pageIndex);        //设置新的分页索引                    
                                        this.loadData(getPageWpdj(parseInt(pageIndex) + 1));        //加载数据
                                        //this.setRecordCount(getRecordCount());
                                 },
                                 sorting: function(event,sortField,sortDirection,columnId){
                                         console.log(sortField);
                                         console.log(sortDirection);
                                         console.log(columnId);
                                 }
                               
                        },  
                    });
                                var grid1 = F.ui.grid1;
                    grid1.setRecordCount(getRecordCount());        //设置总记录数
                    //grid1.setSortField("djxh","DESC");
                    grid1.loadData(getPageWpdj(1));       
板凳
发表于 2018-3-2 09:12:50 | 只看该作者
遗留的安静 发表于 2018-3-1 22:23
F.ui({
                        type: 'grid', id: 'grid1', renderTo: '#wrap1', width: 700, collapsible: tru ...

看示例源代码,要设置列的sortable属性

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
地板
 楼主| 发表于 2018-3-6 17:08:18 | 只看该作者
好的,已经找到问题了.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|FineUI 官方论坛 ( 皖ICP备2021006167号-1 )

GMT+8, 2024-4-20 07:30 , Processed in 0.061483 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表