|
|
2011年7月29日
ext4默认都是没办法选文字复制的,EXT3可以很快解决这个问题,可是EXT4找了好久都没有找到。 把官方都搜索遍也没有; 第一感觉是样式改下应该可以吧,.x-selectable, .x-selectable * {-moz-user-select:text!important;-khtml-user-select:text!important;-webkit-user-select:text!important;} 还是一样的不行; 第二找到一代码 Ext.view.TableChunker.metaRowTpl = [ '<tr class="' + Ext.baseCSSPrefix + 'grid-row {addlSelector} {[this.embedRowCls()]}" {[this.embedRowAttr()]}>', '<tpl for="columns">', '<td class="{cls} ' + Ext.baseCSSPrefix + 'grid-cell ' + Ext.baseCSSPrefix + 'grid-cell-{columnId} {{id}-modified} {{id}-tdCls} {[this.firstOrLastCls(xindex, xcount)]}" {{id}-tdAttr}><div class="' + Ext.baseCSSPrefix + 'grid-cell-inner ' + Ext.baseCSSPrefix + 'selectable" style="{{id}-style};">{{id}}</div></td>', '</tpl>', '</tr>' ]; Ext.override(Ext.grid.View, { cls: Ext.baseCSSPrefix + 'grid-view ' + Ext.baseCSSPrefix + 'selectable' }); 重写view的,效果不错,没有了unselectable = "on"了,可是还是不行; 最后想到是JS的selectstart 事件再作用,打开EXT4的源代码,找到了unselectable方法下有me.swallowEvent("selectstart", true); 问题就是在这了; 最终解决方法: Ext.override(Ext.view.Table, { afterRender: function() { var me = this; me.callParent(); me.mon(me.el, { scroll: me.fireBodyScroll, scope: me }); me.attachEventsForFeatures(); }
2011年1月3日
本来采用uft-8,在导出csv里出现用excel打开乱码的问题, 用 notepad打开,发现文件中的内容没有乱码,看编码是uft-8无BOM; 手动转为有BOM的uft-8后,用excel打开就正常了; 所以要导出的文件正常打开,就要导入有BOM的文件; 有BOM以0xEF;0xBB;0xBF; 开头; C# byte[] buffer = System.Text.Encoding.GetEncoding("utf-8").GetBytes(str); Response.AppendHeader("Content-Disposition", "attachment;filename=\"截止" + totolMonth.EndTime.ToShortDateString() + "结算报表.csv\""); Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); byte[] outBuffer = new byte[buffer.Length + 3]; outBuffer[0] = (byte)0xEF;//有BOM,解决乱码 outBuffer[1] = (byte)0xBB; outBuffer[2] = (byte)0xBF; Array.Copy(buffer, 0, outBuffer, 3, buffer.Length); return File(outBuffer, "application/ms-excel"); 不过本方法只能在win里用吧,其它操作系统就不知道了。
2010年8月31日
摘要: 增加表结构代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->SETANSI_NULLSONGOSETQUOTED_IDENTIFIERONGOCREATETABLE[dbo].[sys_Area]([ID][int]IDENTITY(1,1)NOT... 阅读全文
2010年8月27日
Ext真的强大,所以选择来做后台,在做一个权限时发现了一个问题,也不知道是不是BUG,如果有遇到同样的问题,请指教,3Q
在说明问题之前,先说下我怎么写的Ext,我做采用JS调用,所有JS都是动态加载,就是菜单点击时才加载一个JS(通过网上的Ext.ux.JSLoader,小有改动);
动态加载的好处自认为可以解决在不影响第一次打开加载过多JS而造成的问题,在加载JS到TabPanel后,如果再点同样菜单是不会再加载JS的,脚本做了判断(这个很重要,后面的问题可以排除是多次加载造成的);
下面是问题: Ext.form.FormPanel在加载后出现反复加载items中的控件,而且加载不全,有的没了有的又多了;第一次加载有FormPanel的js,都是正常的,如果再加载一次就会出问题如图那样的反复加载items中的内容;
感觉数据库来的数据不会有问题,道是加到formpanel的静态控件checkbox有问题


- permission = function(node) {
- var checkall = new Ext.form.Checkbox({ id: 'checkall', name: 'checkall', fieldLabel: '功能名称', boxLabel: '全选', inputValue: true,
- handler: function() {
- if (this.checked) {
- Ext.select('input[name^=cbopitem]').each(function() { this.checked = true; });
- } else {
- Ext.select('input[name^=cbopitem]').each(function() { this.checked = false; });
- }
- }
- });
- var form = new Ext.form.FormPanel({
- id: 'roleopform',
- title: '当前位置:角色管理 > ' + node.text,
- border: false,
- plain: true,
- layout: "form",
- buttonAlign: 'center',
- bodyStyle: 'padding:0 10px 0;',
- items: [checkall],
- buttons: [{
- text: '保存',
- handler: function() {
- if (form.getForm().isValid()) {
- Ext.MessageBox.show({ title: '提示框', msg: '你确定要修改吗?', buttons: Ext.MessageBox.OKCANCEL, icon: Ext.MessageBox.WARNING,
- fn: function(btn) {
- if (btn == 'ok') {
- form.getForm().submit({
- waitMsg: "数据保存中...",
- title: "请稍侯",
- url: '/sys/permissionsave',
- params: { id: node.attributes.id },
- success: function(form, response) {
- var temp = Ext.util.JSON.decode(response.response.responseText);
- Ext.Msg.alert("系统提示!", temp.msg);
- },
- failure: function(form, response) {
- Ext.MessageBox.alert("提示!", "保存信息失败!");
- }
- });
- }
- }
- });
- }
- }
- }, {
- text: '取消',
- handler: function() {
- form.getForm().reset();
- }
- }
- ]
- });
-
- var conn = Ext.lib.Ajax.getConnectionObject().conn;
- conn.open("POST", '/sys/permission/' + node.attributes.id, false);
- conn.send(null);
- var perJson = Ext.util.JSON.decode(conn.responseText);
-
- var checklist = [];
- conn.open("POST", '/sys/loadappselect', false);
- conn.send(null);
- var respText = Ext.util.JSON.decode(conn.responseText);
- Ext.each(respText, function(item) {
- var id = item.ID;
- var path = item.Path;
- var name = item.Name;
- name = GetCategoryPath(path, '|') + name;
- var checkGroup = [];
-
- conn.open("POST", '/sys/operation/' + id, false);
- conn.send(null);
- var respText1 = Ext.util.JSON.decode(conn.responseText);
- Ext.each(respText1, function(item1) {
-
- conn.open("POST", '/sys/field/' + item1.ID, false);
- conn.send(null);
- var respField = Ext.util.JSON.decode(conn.responseText);
- var opname = item1.Operation;
- if (respField.length > 0) opname += '(<a href="javascript:;">设置字段</a>)';
- var chk = { xtype: 'checkbox', boxLabel: opname, name: 'cbopitem', inputValue: item1.ID, checked: getopIscheck(perJson, item1.ID) };
- checkGroup.push(chk);
- });
- if (checkGroup.length > 0)
- checklist.push(new Ext.form.CheckboxGroup({ fieldLabel: name, columns: 1, items: checkGroup }));
- });
- form.add(checklist);
- GridMain(node, form);
- };
- function getopIscheck(perJson, opid) {
- var check = false; length
- for (var i = 0; i < perJson.length; i++) {
- if (perJson[i].OperationID == opid) {
- check = true;
- break;
- }
- }
- return check;
- }
解决方法是formpanel的字段不要有ID这个属性
2007年6月4日
Select()是提取数据库的数据的方法,采用第一次从数据库提取,之后缓存起来并从缓存中提取数据;下面是将它赋给一个实体集合hc_MaterialCategory;hc_MaterialCategory的结构就是get set; public static List<hc_MaterialCategory> Select(string sortExpression) { string key = "hc_MaterialCategory_" + sortExpression; List<hc_MaterialCategory> lists = null; if (Cache[key] != null) { lists = (List<hc_MaterialCategory>)Cache[key]; } else { lists = dal.Select(sortExpression); CacheData(key, lists); } return lists; } 问题在下面: public static List<hc_MaterialCategory> Selectddl() { List<hc_MaterialCategory> lists = Select(); hc_MaterialCategory list = new hc_MaterialCategory(); list.MatCategoryCode = "0"; list.MatCategory = ""; lists.Insert(0, list); return lists; } 这样,前台aspx调用 Selectddl()的时候,刷新一次,就会insert一次,而不是理想中的只有一次; List<hc_MaterialCategory> lists = Select();改为List<hc_MaterialCategory> lists = dal.Select("");直接数据库提取数据就会是理想中的只有insert一次
2006年11月18日
摘要: 在Global里的Application_BeginRequest加protected void Application_BeginRequest(Object sender, EventArgs e){Response.Filter = new FontcConversion(Response.Filter);}增加一个类usingSystem;usingSystem.Text;usingSystem.Text.RegularExpressions;usingSystem.IO;usingSystem.Web;/**////<summary>///CG2BFilter的摘要说明///</su 阅读全文
2006年11月17日
摘要: usingSystem;usingSystem.Web;usingSystem.Collections;namespacetest.binary{/**////<summary>///Class1的摘要说明。///</summary>publicclassBlogSiteSettings{privateHashtableblogsettings=newHashtable()... 阅读全文
2006年9月16日
摘要: usingSystem;usingSystem.Collections;usingSystem.Collections.Specialized;usingSystem.IO;usingSystem.Runtime.Serialization.Formatters.Binary;namespacetest{/**////<summary>///User的摘要说明。///</summ... 阅读全文
摘要: 首先要有一个www.xxx.com的域名建两个站点,aa.xxx.com.bb.xxx.com两个的登录基本上是一样的,其实就是Domain = ".kibo.cn"的作用.CREATE TABLE [dbo].[users] ([uid] [int] IDENTITY (1, 1) NOT NULL ,[UserName] [varchar] (50) COLLATE Chinese_PRC_C... 阅读全文
|