首页 新闻 会员 周边

TextBox ReadOnly属性

0
[待解决问题]

TextBox  ReadOnly属性设置成true以后页面刷新TextBox 的值会消失,

               Enabled 属性也一样,谁有好的解决方案说一下~~多谢各位了~

问题补充: openTab: function(link) { var id = !link.href ? Ext.id() : link.href.replace(/[^A-Z0-9-_]/gi, ''); var tab; var html = '<iframe id="iframe' + id + '" width="100%" src="'; if (link.href.indexOf('?') < 0) { link.href = link.href + "?PageID=" + id + "&PageTitle=" + encodeURI(link.text.replace(/['\&''\?']/gi, '')); } else { link.href = link.href + "&PageID=" + id + "&PageTitle=" + encodeURI(link.text.replace(/['\&''\?']/gi, '')); } //End Add var tabTip = link.text; if (typeof (link.tip) != 'undefined') { tabTip += link.tip; } html = html + link.href; html = html + '" height=100% name="iframe' + id + '" frameborder="0" scrolling="auto" style="border:0px none;" ></iframe>'; if (!(tab = this.getItem(id))) { tab = new Ext.Panel({ id: id, cls: 'preview single-preview', title: link.text, tabTip: tabTip, html: html, closable: true, listeners: AppPortal.LinkInterceptor, autoScroll: true, border: true//, }); this.add(tab); } this.setActiveTab(tab); },
yangyueming的主页 yangyueming | 初学一级 | 园豆:2
提问于:2010-11-23 14:06
< >
分享
所有回答(4)
0

我估计你是这样:

程序本身的ReadOnly不是true,你用程序代码改成了true,Enable也一样。

然后,你刷新了,等于是回到了初始状态

所以,你在程序设置时,在属性中设置成ture or fasle,绝对不会如些。。。

刷新等于重新加载。。。

Tester Chen | 园豆:1690 (小虾三级) | 2010-11-23 14:10
0

通过脚本控制ReadOnly或设置Attribute的ReadOnly

有容乃大 | 园豆:5 (初学一级) | 2010-11-23 14:24
0

我估计你是用 js修改了 readonly=readonly,当postback之后,值是不会提交的,在form中所有input html,如果是disabled或者readonly,都不会post的,所以Server不会更新ViewState的值,postback之后,值就会消失。

有两种解决方法

1) 当 post 的时候,把textbox的Readonly或者Disabled 去除,如 document.forms[0].onsubmit=function(){ $("#textbox").removeAttr("readonly"); return true;} 

2)在Textbox上面加focus事件,当focus到这个Texbox的时候,自动失去焦点。那么相当于readonly

沉默的糕点 | 园豆:1786 (小虾三级) | 2010-11-23 15:19
0

纯js操作刷新之后是保存不了状态的

回楼上,readonly可以提交,disabled不会...

三桂 | 园豆:3565 (老鸟四级) | 2010-11-23 17:22
LeftPanel = function() { LeftPanel.superclass.constructor.call(this, { id: 'menu-tree', region: 'west', title: '', //Navigation split: true, width: 225, minSize: 175, maxSize: 400, collapsible: true, margins: '0 0 5 5', cmargins: '0 5 5 5', rootVisible: false, lines: false, autoScroll: true, rootVisible: false, root: new Ext.tree.TreeNode('Menu Tree'), collapseFirst: false , tbar: [{ iconCls: 'add-icon', text: '新建项目', tooltip: '创建新项目', handler: function() { AppPortal.mainPanel.openTab({ href: 'HardwareProject/HardwareProject.aspx', text: '新建项目' }); }, scope: this }, { id: 'home', iconCls: 'home-icon', text: '我的任务', tooltip: '返回我的任务', handler: function() { AppPortal.mainPanel.loadLink({ href: 'Home.aspx', text: '我的任务' }); }, scope: this }, { id: 'test_center', iconCls: 'bug-icon', text: 'Report a Bug', tooltip: 'Bug 管理系统', handler: function() { AppPortal.mainPanel.openTab({ href: 'http://hcmm-test.h3c.com:8000/scarab', text: 'Bug 管理系统' }); }, scope: this }] }); this.menus = this.root.appendChild( Portal.navData //End modify ); Portal.navData = null; this.on({ 'click': function(node, eve) { if (node) { this.fireEvent('menuselect', node.attributes); } }, scope: this }); //End modify this.addEvents({ menuselect: true });
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-11-26 10:22
Ext.extend(LeftPanel, Ext.tree.TreePanel, { onContextMenu : function(node, e){ if(!this.menu){ // create context menu on first right click this.menu = new Ext.menu.Menu({ id:'menus-ctx', items: [{ id:'load', iconCls:'load-icon', text:'Load menu', scope: this, handler:function(){ this.ctxNode.select(); } },{ text:'Remove', iconCls:'delete-icon', scope: this, handler:function(){ this.ctxNode.ui.removeClass('x-node-ctx'); this.removemenu(this.ctxNode.attributes.url); this.ctxNode = null; } },'-',{ iconCls:'add-icon', text:'Add menu', handler: this.showWindow, scope: this }] }); this.menu.on('hide', this.onContextHide, this); } if(this.ctxNode){ this.ctxNode.ui.removeClass('x-node-ctx'); this.ctxNode = null; } if(node.isLeaf()){ this.ctxNode = node; this.ctxNode.ui.addClass('x-node-ctx'); this.menu.items.get('load').setDisabled(node.isSelected()); this.menu.showAt(e.getXY()); } }, onContextHide : function(){ if(this.ctxNode){ this.ctxNode.ui.removeClass('x-node-ctx'); this.ctxNode = null; } }, selectmenu: function(url){ this.getNodeById(url).select(); }, removemenu: function(url){ var node = this.getNodeById(url); if(node){ node.unselect(); Ext.fly(node.ui.elNode).ghost(
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-11-26 10:22
'l', { callback: node.remove, scope: node, duration: .4 }); } }, addmenu : function(attrs, inactive, preventAnim){ var exists = this.getNodeById(attrs.url); if(exists){ if(!inactive){ exists.select(); exists.ui.highlight(); } return; } Ext.apply(attrs, { iconCls: 'menu-icon', leaf:true, cls:'menu', id: attrs.url }); var node = new Ext.tree.TreeNode(attrs); this.menus.appendChild(node); if(!inactive){ if(!preventAnim){ Ext.fly(node.ui.elNode).slideIn('l', { callback: node.select, scope: node, duration: .4 }); }else{ node.select(); } } return node; }, // prevent the default context menu when you miss the node afterRender : function(){ LeftPanel.superclass.afterRender.call(this); this.el.on('contextmenu', function(e){ e.preventDefault(); }); } }); Ext.reg('appLeftPanel', LeftPanel);
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-11-29 17:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册