基於ExtJS實現床位卡

來源:互聯網
上載者:User

標籤:des   style   blog   http   io   os   使用   java   ar   

ExtJS的模板的使用:

項目中情境基本就是表格模型:

  TPL:自己編寫模板

  store:資料來源

  UI組件:

  tbar,rbr,bbar實現工具列

  PageBar與StatusBar:可以針對TPL的組件進行分頁

  SVG可以實現路徑繪圖

 DataView就是UI與TPL,Store聯絡起來

==============================================

提示組件:

var tip = new Ext.ToolTip({
target: ‘dp‘,
title: ‘提示詳細‘,
width:200,
html: ‘確定要查看這個床位的病人的詳細資料嗎?‘,
trackMouse:true
});

工作群組件:

ExtJS對定時的任務的設定,一般的情境就是頁面的週期性重新整理,比如30分鐘,對比Flex的重新整理任務也類型,其實就是他的編程模型簡單,理解起來也是比較容易

定時器,模板TPL,Store這才是情境開發中最重要的地方

===============================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>New Web Project</title> <link rel="stylesheet" type="text/css" href="ext-3.4.0/resources/css/ext-all.css" /> <link rel="stylesheet" type="text/css" href="data-view.css" /> <script language="JavaScript" src="ext-3.4.0/adapter/ext/ext-base.js"> </script> <script language="JavaScript" src="ext-3.4.0/ext-all.js"> </script> <script language="JavaScript"> Ext.onReady(function(){ var rightMenu = new Ext.menu.Menu({ items: [{ text: ‘執行醫囑‘, handler: function(){alert("執行醫囑");} }, { text: ‘瀏覽病程‘, handler: function(){alert("瀏覽病程");} }, { handler: function(){alert("病案首頁");}, text: ‘病案首頁‘ }, ‘-‘, { text: ‘檢查檢驗‘, handler: function(){new Ext.Window({title:‘檢查檢驗‘,width:400,height:300,html:‘減價檢驗詳細‘,buttons:[{text:‘確定‘}]}).show();} }] }); var store = new Ext.data.JsonStore({ fields: [‘name‘, ‘url‘, ‘shortName‘,{ name: ‘size‘, type: ‘float‘ }, { name: ‘lastmod‘, type: ‘date‘, dateFormat: ‘timestamp‘ }], data: [{ name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘aaaaaaaaaaaaa‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }, { name: ‘aaaa‘, url: ‘images/thumbs/dance_fever.jpg‘, shortName: ‘C-108床‘ }] }); var tpl = new Ext.XTemplate(‘<tpl for=".">‘, ‘<div class="thumb-wrap" id="{name}">‘, ‘<div class="thumb"><img src="{url}" title="{name}"></div>‘, ‘<span class="x-editable">{shortName}</span></div>‘, ‘</tpl>‘, ‘<div class="x-clear"></div>‘); new Ext.Panel({ title: ‘床位卡面板‘, id: ‘images-view‘, width: 720, height: 300, renderTo: ‘div‘, items: new Ext.DataView({ store: store, tpl: tpl, autoHeight: true, multiSelect: true, overClass: ‘x-view-over‘, emptyText: ‘No images to display‘, listeners: { contextmenu: function(dataView, index, node, e){ if (node.tagName == "IMG") { dataView.menu = rightMenu; dataView.menu.showAt(e.getXY()); e.stopEvent(); } } } }), listeners: { selectionchange: { fn: function(dv, nodes){ var l = nodes.length; var s = l != 1 ? ‘s‘ : ‘‘; panel.setTitle(‘Simple DataView (‘ + l + ‘ item‘ + s + ‘ selected)‘); } } } });Ext.getBody().on("contextmenu", Ext.emptyFn,null, {preventDefault: true}); }); </script> </head> <body> <div id="div"> </div> </body></html>

  

基於ExtJS實現床位卡

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.