Tag: extjs

直接点击事件触发前的表单validation

我有一个按钮,我想在直接点击事件之前形成validation(客户端)。我尝试了很多但是失败了。 **我已经设置了这样的文本框。 但即使在文本框检查之前仍然直接开火

Extjs Ajax文件下载请求C#MVC

我希望客户端在单击按钮时下载存储在我的数据库中的文件。 我发送这个ajax请求并从服务器端获取它。 EXTJS: downloadFile: function (a, b, c) { var feed_id =this.getMyfeedwindow().down(‘form’).getComponent(‘FeedId’).text; Ext.Ajax.request({ url: ‘/Feed/Download’, method: ‘GET’, params: { fileID: feed_id, //this.form.getComponent(‘file’).value, }, failure: function (response) { alert(‘failed !’); }, success: function (response) { alert(‘success!’); }, }); }, 然后用这个代码块满足请求。 C#: public void Download(string fileID){ Response.ContentType = “application/force-download”; Response.AddHeader(“Content-Disposition”, “attachment; Filename=\”Logo1.jpg\””); Response.BinaryWrite(data); Response.End(); } 当我用firebug检查网络时,似乎我的请求使用这些参数成功返回。 Cache-Control […]

从服务器端动态检索GridPanel模型/存储/列

我有一个GridPanel,在DB SP返回表的列之后,必须动态创建它的商店模型和列模型。 我的问题是如何将值(字符串或JSON)从服务器传递给GridPanel? Ext.define(‘Base.GridPanel’, { extend: ‘Ext.grid.Panel’, xtype: ‘gridpanel’, flex: @BFE.Frontend.Defaults.BaseGridPanel.flex, hideMode: ‘@BFE.Frontend.Defaults.BaseGridPanel.hideMode’, collapsible: true, constructor: function(id, title, columns, store) { this.id = id; this.title = title; this.columns = columns; this.store = store; this.callParent(); } }); 我现在使用这个自定义的GridPanel以及以下模型和存储。 Ext.define(‘Tasks’, { extend: ‘Ext.data.Model’, fields: [ {name: ‘Case_ID’, type: ‘@MCSJS.Models.DataType.Auto’}, {name: ‘BP_Name’, type: ‘@MCSJS.Models.DataType.Auto’}, {name: ‘Project’, type: ‘@MCSJS.Models.DataType.Auto’}, […]

ExtJS:如何使用asp.net mvc返回json成功w / data

我正在尝试将ExtJS与Asp.Net MVC一起使用,到目前为止一切正常。 (在ExtJS上做得很好)为了简化操作,我需要一些帮助将数据从.net返回到ExtJS。 ExtJS希望在JSON Respone中看到成功标志以及其他数据。 样本预期响应格式是类似的 {success:true,data:{id:3,text:“hello world}} 所以,使用linq2sql或ado.net数据集作为模型对象,您是否知道如何以这种格式轻松返回数据。 就像是 public JsonResult Index() { result.success= true; result.obj = repository.FindAllUsers(); return Json(result) } 会顺便说一下吗? 如果我有一个具有bool成功和对象数据属性的ExtJSResult类? 提前致谢

在ASP.NET中使用Ext JS

我没有JavaScript的高级知识,我正在尝试学习如何在ASP.NET(C#或VB.NET)环境中使用Ext JS框架。 我有几个样本,但无法让项目正常运行。 有没有网站或书籍,所以我可以阅读有关Ext JS的更多详细信息,如何将其包含在我的网站中?

如何查找具有动态ID的ExtJS元素

我正在使用Selenium,需要获取控件的ID,但ID是动态的,我无法得到它。 数字1122是动态的,还有其他按钮具有相同的开始button-###+btnWrap 。

分析器错误消息:无法创建类型’xxx’

我收到这个错误 Parser Error Message: Could not create type ‘charts.lineChartData’. Source Error: Line 1: Source File: /WebSiteNetPas/lineChartData.ashx Line: 1 ——————————————————————————– Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 事实上我在使用fiddler时遇到这个错误,我原来的错误是: Uncaught ReferenceError: lineChartData is not defined lineChart.js:20 http://localhost/WebSiteNetPas/lineChartData.ashx?proxy 500 (Internal Server Error) 这是我的lineChartData.ashx.cs : using System; using System.Web; using System.Linq; using System.Collections.Generic; using Newtonsoft.Json.Linq; using System.Web.Script.Serialization; namespace […]

如何在处理Json时修复循环引用错误

这个问题是我在这里的原始post的一部分获取数据到Extjs GridPanel 下面是我的控制器从sql db读取数据然后我试图将结果编码为JSON并将数据发送回我的gridview.js public JsonResult writeRecord() //public string writeRecord() { Response.Write(“Survey Completed!”); SqlConnection conn = DBTools.GetDBConnection(“ApplicationServices2”); string sqlquery = “SELECT Q1, Q2, Q3, Q4, Improvements, Comments FROM myTable”; SqlDataAdapter cmd = new SqlDataAdapter(sqlquery, conn); DataSet myData = new DataSet(); cmd.Fill(myData, “myTable”); conn.Open(); conn.Close(); return Json(myData, JsonRequestBehavior.AllowGet); //return myData.GetXml(); } 这就是问题所在,使用上面的代码,我在执行gridview.js时得到的gridview表没有数据,但如果我直接访问我的控制器的方法就像这样 http://localhost:55099/GridView/writeRecord 我收到这个错误, 序列化“System.Globalization.CultureInfo”类型的对象时检测到循环引用。 描述:执行当前Web请求期间发生未处理的exception。 […]

iTextSharp生成PDF:如何将pdf发送到客户端并添加提示?

我已经使用iTextSharp生成了一个pdf,当它创建时,它会自动保存在我的代码中提供的位置,而不是在客户端的服务器上,当然也不会告诉用户任何东西。 我需要将它发送给客户端,我需要提示一个对话框询问用户他想要保存他的pdf的位置。 我该怎么办? 这是我的pdf代码: using (MemoryStream myMemoryStream = new MemoryStream()) { Document document = new Document(); PdfWriter PDFWriter = PdfWriter.GetInstance(document, myMemoryStream); document.AddHeader(“header1”, “HEADER1”); document.Open(); //………. document.Close(); byte[] content = myMemoryStream.ToArray(); // Write out PDF from memory stream. using (FileStream fs = File.Create(HttpContext.Current.Server.MapPath(“~\\report.pdf”))) { fs.Write(content, 0, (int)content.Length); } 编辑 这是我想要http://examples.extjs.eu/?ex=download的结果示例 感谢您的回复,我修改了我的代码: HttpContext.Current.Response.ContentType = “application/pdf”; HttpContext.Current.Response.AppendHeader( “Content-Disposition”, […]