恩 简单看了smartclient的文档,感觉和extjs差不多,和jquery也很相像,就是不明白为什么要用这个呢?
那个文档是纯英文的,本来我想翻译出来着,后来被同事打击了一顿,万一别人想学,看了我翻译的文档就饱了 ,哈哈。这篇译文我先放着。
下面是我做的小练习:
<html> <head> <title>this is a test !</title> <SCRIPT>var isomorphicDir="../../isomorphic/";</SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_History.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Core.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Foundation.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Containers.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Grids.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_Forms.js></SCRIPT> <SCRIPT SRC=../../isomorphic/system/modules/ISC_DataBinding.js></SCRIPT> <SCRIPT SRC=../../isomorphic/skins/SmartClient/load_skin.js></SCRIPT> </head> <body> <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=5 BORDER=0> <TR><TD CLASS=pageHeader BGCOLOR=WHITE>按钮的测试</TD> <TD CLASS=pageHeader ALIGN=RIGHT BGCOLOR=WHITE>so easy!</TD> </TR></TABLE> <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD BGCOLOR=336666><IMG SRC=images/blank.gif WIDTH=1 HEIGHT=4></TD></TR></TABLE> <script> //创建一个按钮单击事件----- isc.Button.create({ ID:"clickBtn", left:50, top:70, title:"快单击我*_*", click:"clickBtnClicked()" }) function clickBtnClicked(){ isc.warn('单击我干嘛!'); } function clickBtnClick(){ isc.warn('想提交 没那么简单!'); } isc.ListGrid.create({ ID: "contactsList", left: 800, top: 50, width: 300, fields: [ {name:"salutation", title:"Title"}, {name:"firstname", title:"First Name"}, {name:"lastname", title:"Last Name"} ] }) //在一个form里面创建页面元素 DynamicForm.create({ ID:"pane1", autoDraw:false, titleOrientation:"top", itemChange : function (){ Page.setUnloadMessage("Exiting the page now will lose changes"); }, //-----------------------------------------select 下拉框 date 日期 radioGroup单选框 checkbox 多选框 textArea 文本域 button 按钮------------------------------------------------- fields:[ {name:"firstName", title:"姓",editorType:"select",valueMap:["王","李","张"]}, {name:"lastName", title:"名"}, {name:"birthday",title:"出生年月日",editorType:"date"}, {name:"followup",title:"性别",editorType:"radioGroup",valueMap:["猛男","靓女"]}, {name:"hobby",title:"爱好",editorType:"checkbox"},{name:"hobby",title:"爬山",editorType:"checkbox"}, {name:"remark",title:"备注",editorType:"textArea",width:250}, {name:"upload",title:"上传图片",editorType:"upload"}, {name:"submit",title:"提 交",editorType:"button",width:50,click:"clickBtnClick()"}, {name:"reset",title:"重 置",editorType:"button",width:50,click:"clickBtnClicked()"} ] }); DynamicForm.create({ ID:"pane2", autoDraw:false, titleOrientation:"top", itemChange : function () { Page.setUnloadMessage("Exiting the page now will lose changes"); }, fields:[ {name:"手机号码:", title:"手机号码"}, {name:"移动电话", title:"移动电话"}, {name:"联系地址",title:"地址"}, {name:"City",title:"所在城市"} ] }); DynamicForm.create({ ID:"pane3", autoDraw:false, titleOrientation:"top", itemChange : function (){ Page.setUnloadMessage("Exiting the page now will lose changes");//当用户填写了页面中的内容、关闭该页面的时候,弹出提示框 }, fields:[ {name:"address", title:"家庭住址"}, {name:"city", title:"所在地址"}, {name:"state", title:"婚姻状态"}, {name:"zip", title:"有小孩否"} ] }); isc.History.registerCallback("historyCallback(id)"); isc.Page.setEvent("load", "restoreTabSetState()"); function restoreTabSetState() { isc.Log.logWarn("restoring state"); if (!isc.History.haveHistoryState()) { tabSet.jumpToTab(isc.History.getCurrentHistoryId() || 0); } } function historyCallback(id) { // the id is the tabNum and null is initial state - which is the first tab. tabSet.jumpToTab(id == null ? 0 : id); } TabSet.create({ ID:"tabSet", top:50, left:180, width:600, height:400, rememberHistory : true, jumpToTab : function (tabNum) { this.noHistory = true; this.selectTab(new Number(tabNum)); this.noHistory = false; }, tabSelected : function (tabNum) { if (!this.noHistory && isc.Page.isLoaded()) isc.History.addHistoryEntry(tabNum); }, tabs:[{title:"个人资料", pane:pane1, width:70}, {title:"联系方式", pane:pane2, width:70}, {title:"隐私秘密", pane:pane3, width:70} ] }); </script> </body> </html>