Ext.require([

    'Ext.grid.*',
    'Ext.data.*',
    'Ext.util.*',
    'Ext.grid.PagingScroller',
    'Ext.ux.RowExpander',
    'Ext.selection.CheckboxModel'
     
]);
 
Ext.onReady(function(){
    Ext.define('ForumThread', {
        extend: 'Ext.data.Model',
        fields: [
            'title''forumtitle''forumid''author',
            {name: 'replycount', type: 'int'},
            {name: 'lastpost', mapping: 'lastpost', type: 'date', dateFormat: 'timestamp'},
            'lastposter''excerpt''threadid'
        ],
        idProperty: 'threadid'
    });
 
    // create the Data Store
     var sm = Ext.create('Ext.selection.CheckboxModel');
     
    var store = Ext.create('Ext.data.Store', {
        id: 'store',
        pageSize: 200,
        model: 'ForumThread',
        remoteSort: true,
        // allow the grid to interact with the paging scroller by buffering
        buffered: true,
        proxy: {
            // load using script tags for cross domain, if the data in on the same domain as
            // this page, an HttpProxy would be better
            type: 'jsonp',
            url: 'http://www.sencha.com/forum/remote_topics/index.php',
            extraParams: {
                total: 50000
            },
            reader: {
                root: 'topics',
                totalProperty: 'totalCount'
            },
            // sends single sort as multi parameter
            simpleSortMode: true
        },
        sorters: [{
            property: 'lastpost',
            direction: 'DESC'
        }]
    });
 
    function renderTopic(value, p, record) {
        return Ext.String.format(
            '<a href="http://sencha.com/forum/showthread.php?t={2}" target="_blank">{0}</a>',
            value,
            record.data.forumtitle,
            record.getId(),
            record.data.forumid
        );
    }
 
    var sm = Ext.create('Ext.selection.CheckboxModel');
      
    var grid = Ext.create('Ext.grid.Panel', {
        width: 700,
        height: 500,
        title: 'checkbox',
        store: store,
        selModel: sm,
        frame: true,
        verticalScrollerType: 'paginggridscroller',
        loadMask: true,
        disableSelection: false,
        invalidateScrollerOnRefresh: false,
        viewConfig: {
        trackOver: false
        },
        // grid columns
        columns:[{
            id: 'topic',
            text: "Topic",
            dataIndex: 'title',
            flex: 1,
            renderer: renderTopic,
            sortable: false
        },{
            text: "Author",
            dataIndex: 'author',
            width: 100,
            hidden: true,
            sortable: true
        },{
            text: "Replies",
            dataIndex: 'replycount',
            align: 'center',
            width: 70,
            sortable: false
        },{
            id: 'last',
            text: "Last Post",
            dataIndex: 'lastpost',
            width: 130,
            renderer: Ext.util.Format.dateRenderer('n/j/Y g:i A'),
            sortable: true
        }],
        renderTo: 'grid-example'
    });
 
     
   // trigger the data store load
    store.guaranteeRange(0, 199);

Ext checkbox的更多相关文章

  1. 基于Extjs的web表单设计器 第六节——界面框架设计

    基于Extjs的web表单设计器 基于Extjs的web表单设计器 第一节 基于Extjs的web表单设计器 第二节——表单控件设计 基于Extjs的web表单设计器 第三节——控件拖放 基于Extj ...

  2. CodeSmith系列(三)——使用CodeSmith生成ASP.NET页面

    仍然使用之前的XML文件,然后设置生成参数如下: 生成调整后的页面如下: 生成的代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...

  3. Ext grid checkbox 分页 翻页 勾选 问题

    timeArray = new Array(); //临时数组变量 var timeStatusBar = new Ext.ux.StatusBar({ id: 'statusbar', defaul ...

  4. [Ext JS 4] 实战之多选下拉单 (带checkbox)

    前言 Ext js 创建一个多选下拉单的方式很简单, 使用Ext.form.ComboBox, 设置 multiSelect 为true 就可以了. 但是如果要在每个下拉之前加上一个checkbox, ...

  5. Ext.Net 1.x_Ext.Net.GridPanel嵌套Checkbox

    解决办法:拼接HTML var tplchecked = '<input type="checkbox" {0}>'; var IsChecked = function ...

  6. Ext z自写checkbox

    软件弹出框Exr.window里面有许多个CheckBox,用ext自带的CheckBoxGroup也可以实现,但是在后期处理的时候远没有自写的CheckBox灵活,还出了一些莫名其妙的bug 忍无可 ...

  7. [Irving] Ext.Net动态添加GridPanel列绑定Checkbox值失败的解决办法

    var grid = X.GetCmp<GridPanel>(vm.GRID_QUOTATIONS_FEEITEM_RANGE_SHOW); grid.AddColumn(Html.X() ...

  8. ext.net 实现gridpanel checkbox锁定

    <%@ Page Language="C#" %> <%@ Register Assembly="Ext.Net" Namespace=&qu ...

  9. Ext小总结

    titleCollapse:true,//高级搜索点击隐藏显示 添加按钮 >弹出页面 1.添加按钮 //核销  在控制层页面添加页面路径>添加操作按钮>window.allOrder ...

随机推荐

  1. Unity NGUI 网络斗地主 -界面制作

    Unity NGUI 网络斗地主 -界面制作 源文件在群(63438968群共享!) @灰太龙 这一节说一下NGUI的界面摆放,并且教会大家使用NGUI的自适应功能! 在这里感谢@Gamer,是他给我 ...

  2. sphinx插入css

    使用role指令达到目的. We can put following lines at the beginning of our RST file to specify its style. .. r ...

  3. FFmpeg常用基本命令

    FFmpeg常用基本命令 1.分离视频音频流 ffmpeg -i input_file -vcodec copy -an output_file_video //分离视频流 ffmpeg -i inp ...

  4. 1710: [Usaco2007 Open]Cheappal 廉价回文

    Description 为 了跟踪所有的牛,农夫JOHN在农场上装了一套自动系统. 他给了每一个头牛一个电子牌号 当牛走过这个系统时,牛的名字将被自动读入. 每一头牛的电子名字是一个长度为M (1 & ...

  5. ♫【Backbone】this

    Backbone.js Event Binding MyView = Backbone.View.extend({ events: { 'click .item': 'handleClick' }, ...

  6. (转载)PHP常用函数

    (转载)http://www.cnblogs.com/dreamhome/archive/2011/05/04/2037011.html <?php //==================== ...

  7. a为整型数组,&a+1的含义

    #include <stdio.h> int main() { int a[10]; printf("a的值为:\t%d\n",a); printf("&am ...

  8. firefox HackBar组件模拟请求POST请求

    组件下载地址:https://addons.mozilla.org/zh-CN/firefox/addon/hackbar/

  9. SRM 396(1-250pt)

    DIV1 250pt 题意:对于一个字符串s,若对于每一个i = 0 to s.size()-p-1都有s[i] = s[i+p]则称字符串s是p循环的."CATCATC", &q ...

  10. Seek the Name, Seek the Fame - POJ 2752(next运用)

    题目大意:小猫是非常有名气的,所以很多父母都来找它给孩子取名字,因为找的人比较多,小猫为了摆脱这个无聊的工作,于是它发明了一种取名字的办法,它把孩子父母的名字合在一起,然后从这个名字里面找一个前缀,并 ...