English 中文(简体)
第3条
原标题:DataView with Extjs 3

I create a panel that show me on the left thumbnails of images and when I click on an image it shows on the right panel. It works but i want when i open this page and without clicking on any thumb, it shows me on the right panel a defaut image (this value contain the link of the default image D.data.defaultimage)

这是我的本小组守则:

var Pstore = new Ext.data.JsonStore({
        proxy: new Ext.data.HttpProxy({
            url:  page.php?cmd=Affich ,
            method:  POST 
        }),
        root:  images ,
        fields: [  name ,  url ,  thumb_url  ]
    });
    Pstore.load();

    var tpl = new Ext.XTemplate(
         <tpl for="."> ,
             <div class="thumb-wrap" id="{name}"> ,
             <center><img src="{thumb_url}" title="{name}"></center> ,
                 <span>{name}</span></div> ,
         </tpl> 
    );
    tplDetail = new Ext.XTemplate(
         <div class="details"> ,
             <tpl for="."> ,
                 <center><img src="{url}"></center> ,       
             </tpl> ,
         </div> 
    );

    datav = new Ext.DataView({
        autoScroll  : true,
        store       : Pstore, 
        tpl         : tpl,
        autoHeight  : false,
        multiSelect : true,
        overClass   :  x-view-over ,
        itemSelector:  div.thumb-wrap ,
        emptyText   :  No images ,
        listeners: {
            click: {
                fn: function() {
                    selNode = datav.getSelectedRecords();
                    tplDetail.overwrite(panelPreview.body, selNode[0].data);
                    panelPreview.body.fadeIn( l , {duration:0.5});
                }
            }
        }
    })

    var panelLeft = new Ext.Panel({
        id          :  images-view ,
        title       :  Pages ,
        autoScroll  : true,
        region      :  west ,
        frame       : true,
        width       : 180,
        layout      :  fit ,
        items       : datav
    });
    panelPreview = new Ext.Panel({
        title       :  Aperçu: ,
        region      :  center ,
        autoScroll  : true,
        frame       : true,
        layout      :  fit ,
        id          :  panelDetail ,
        tpl         : tplDetail
    });

    Affich = new Ext.FormPanel({
        frame       : true,
        layout      :  border ,
        bodyStyle   :  padding:5px ,
        renderTo    :  right-bottom ,
        items       : [panelLeft, panelPreview]
    });

感谢我的帮助

问题回答

仅凭一对夫妇的快速(未经测试)思想,你就试图使你的小组工作。 复审数据吗? 然后,你可以将其<条码>代号放在你想要的价值观上。 或者,小组有一份<代码>数据,可以申请,根据该数字,这是装入模板的最初一套数据。





相关问题
Is there anyway that we can get a label value to a Sql

SELECT COUNT(*) AS Expr1 FROM Book INNER JOIN Temp_Order ON Book.Book_ID = Temp_Order.Book_ID WHERE (Temp_Order.User_ID = 25) AND (CONVERT (nvarchar, Temp_Order.OrderDate, 111) = CONVERT (nvarchar,...

Create a View of a View in WPF

OK, so I need to create an ICollectionView from an existing ICollectionView. The idea is that I can take whatever filters/grouping/sorting has been set on the existing view and then create other views ...

C# vertically oriented DataGrid: change column names

I m currently using a technique I found while poking around the interwebs for flipping a DataGrid s orientation in C# for a SharePoint web part. It s working correctly, pulling data from a SQL Server ...

How do I use Round with DataView RowFilter?

I m using DataView.RowFilter to filter the DataView and I d like to compare rounded double values rather than the full double values. E.g., the values in the Value column are doubles with lots of ...

热门标签