ITeye博客

Ext工具条

thw · 2010-12-31 16:31 · Ext3.2 · Web前端 · CSS · EXT · JSP · Markdown

1 在jsp指定位置(某个div处)生成工具条
 jsp页面:

.query{
   background-image:url(../images/toolBar/application_form_find.png) !important;
}
<div id="toolBar" class="x-toolbar"></div>

 

<script>

  var indexFun = function(){

    return{

          query: function(){

            

          },

          insert: function(){

 

         },

         update: function(){

 

         },

         download: function(){

 

         }

    }

  }();

</script>

<script>
 Ext.QuickTips.init();  //提示信息
 /**
  * 初始化ext工具条
 */
function initToolBar(){
var toolbar = new Ext.Toolbar({
   applyTo: 'toolBar',
   items: [{
    text: '查询',
    tooltip: '查询',
    iconCls: 'query',  //这里的query为css class类名
    handler: indexFun.query
   },'-',{
    text: '新增',
    tooltip: '新增',
    iconCls: 'add',
    handler: indexFun.insert
   },'-',{
    text: '修改',
    tooltip: '修改',
    iconCls: 'update',
    handler: indexFun.update
   },'-',{
    text: '导出',
    tooltip: '导出',
    iconCls: 'download',
    handler: indexFun.download
   }]
  });
 }

 //初始化       
 Ext.onReady(function(){
  initToolBar();
 });
</script>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。