2011-04-28 84 views
0

使用Ext.Toolbar ExtJS的蔭設計菜單,ExtJS的工具欄按鈕的HIGHlite

var ToolBar = new Ext.Toolbar({ 
      id: 'ToolBar', 
      renderTo: 'divtoolbar', 
      items: [ 
        { xtype: 'spacer', width: 50 }, 
        { xtype: 'tbbutton', text: 'Home', handler: function() { window.location = '@Url.Content("~/Home/Home/")'; } }, 
        { xtype: 'tbseparator' }, 
        { xtype: 'tbbutton', text: 'Calendar', handler: function() { window.location = '@Url.Content("~/calendar/eventCalendar/")'; } }, 
        { xtype: 'tbseparator' }, 
        { xtype: 'tbbutton', text: 'Locations' } 
] 

............ 如何改變或點擊的HIGHlite TBBUTTON在

感謝提前

回答

0

您需要使用按鈕提供的addClass方法。爲拜訪按鈕創建一個CSS樣式,並在處理程序中調用addClass方法。這裏是一個例子:

handler: function(b,e) { 
    this.addClass('className'); 
    } 

但在你的情況,我看到你正在導航遠離頁面。在這種情況下,您必須將訪問過的按鈕存儲在Cookie中或使用HTML5存儲。

我想知道爲什麼你要製作一個多頁的ExtJS應用程序,而不是遵循單頁方法?

+0

感謝您的回覆,,,,,,,,,請給我一個singlepage approch的例子.......謝謝 – MNR 2011-04-28 11:19:55

+0

單頁方式,你不會導航到一個新的頁面。相反,你在同一頁面打開一個窗口,面板等。查看ExtJS示例中提供的「組合示例」。 – 2011-04-28 11:29:10