tom840520 发表于 2013-1-23 02:41:46

查询,grid刷新

grid.getSelectionModel().selectFirstRow();//默认选择第一行
 
http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gifhttp://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif    var store = new Ext.data.SimpleStore(http://www.cnblogs.com/Images/dot.gif{
http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif        fields: [
http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gifhttp://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif           http://www.cnblogs.com/Images/dot.gif{ name: 'company' },
http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gifhttp://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif           http://www.cnblogs.com/Images/dot.gif{ name: 'price', type: 'float' },
http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gifhttp://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif           http://www.cnblogs.com/Images/dot.gif{ name: 'change', type: 'float' },
http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gifhttp://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif           http://www.cnblogs.com/Images/dot.gif{ name: 'pctChange', type: 'float' },
http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gifhttp://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif           http://www.cnblogs.com/Images/dot.gif{ name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia' }
http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif        ]
http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif    });
http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif    store.loadData(myData);//加载数据
 
var fnAjaxDemo = function() {
            var mydata;
            Ext.Ajax.request({
                url: "MyService.svc/GetClsData?name=" + encodeURIComponent(Ext.get("ProductName").dom.value), //服务器端地址
                success: function(request) {                   
                    store.loadData(eval(request.responseText));                   
                },
                failure: function() {
                    alert("failure!");
                }
            });
        }
        Ext.get("btnRefresh").on("click", fnAjaxDemo);
 
3.如果设置了autoExpandColumn,则autoExpandColumn对应的列,必须是id对应的列,否则出错
页: [1]
查看完整版本: 查询,grid刷新