Ext中checkbox显示不出来

如图:
[img]http://dl.iteye.com/upload/attachment/519590/52fb82e7-11a4-347f-9364-23f211260551.jpg[/img]
代码如下:
[code="javascript"]

Ext.onReady(function(){ var sm = new Ext.grid.CheckboxSelectionModel({handleMouseDown:Ext.emptyFn});//复选框 //列模型 var cm = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(),//自动生成行号 sm, {header:"编号",dataIndex:"id",sortable:true}, {header:"姓名",dataIndex:"name"}, {header:"性别",dataIndex:"sex",renderer:function(value){ if(value=='male'){ return "<span style='color:red;font-weight:bold'>红男</span><img src='image/user_male.png'/>"; } else { return "<span style='color:green;font-weight:bold'>绿女</span><img src='image/user_fmale.png'/>"; } }}, {id:"descn",header:"描述",dataIndex:"descn"}, {header:"日期",dataIndex:"date",type:'date',renderer:Ext.util.Format.dateRenderer('Y年m月d日')}]); var data=[['1','啊','male','descn1','1970-01-15T02:58:04'], ['2','啵','fmale','descn2','1970-01-15T02:58:04'], ['3','簎','fmale','descn3','1970-01-15T02:58:04'], ['4','德','male','descn4','2011-03-15T02:58:04'], ['5','咯','male','descn5','2011-05-15T02:58:04']]; var ds = new Ext.data.Store({ proxy:new Ext.data.MemoryProxy(data), reader:new Ext.data.ArrayReader({},[{name:'id'}, {name:'name'}, {name:'sex'}, {name:'descn'}, {name:'date',type:'date',dateFormat:'Y-m-dTh:i:s'}]), sortInfo:{field:'name',direction:'ASC'} }); ds.load();//加载数据 var grid = new Ext.grid.GridPanel({ el:'grid', ds:ds, cm:cm, sm:sm //autoExpandColumn:'descn' }); Ext.get('remove').on('click',function(){ ds.remove(ds.getAt(1)); grid.view.refresh(); }); grid.render();//渲染 }); //alert(Ext.get('remove'));

[/code]
代码可能有点长,大家挑重点的看就可以了~

1个回答

十有八九是样式问题,看你的resource目录是否齐全!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐