Tag: extjs

extjs嵌套json store rails

我正在使用Ext JS&Rails作为后端..我正在使用具有父子关系的myysql数据库,即1对多关系……我想要一个可用于加载“GRID”的“单一”JSON存储带有父记录和子记录的数据..还有什么办法可以将表单和网格绑定到同一个商店但是有不同的jsonreaders吗? 即form的datareader将使用root读取字符串:’customers’和grid将使用root读取字符串:’products’ ? JSON看起来像这样: { “customers”: [{ “amt”: 8000, “custnm”: “rashmi”, “id”: 2, “purdt”: “2011-04-27”, “products”: [{ “amt”: 40, “customer_id”: 2, “id”: 3, “prodnm”: “oil”, “qty”: 1, “rate”: 40 }] }, { “amt”: 300000, “custnm”: “bhumika”, “id”: 3, “purdt”: “2011-04-14”, “products”: [{ “amt”: 40, “customer_id”: 3, “id”: 1, “prodnm”: “soap”, “qty”: 20000, “rate”: 20 […]

extjs编辑器网格更新rails

我正在尝试更新编辑器网格中显示的记录。但是不是更新相同的记录,而是将新记录插入数据库…我错过了什么?pllzz help..following是我的JsonStore代码: Ext.data.Api.restActions = { create : ‘POST’, read : ‘GET’, update : ‘PUT’, destroy : ‘DELETE’ }; ProdStore = Ext.extend(Ext.data.JsonStore, { constructor: function(cfg) { cfg = cfg || {}; ProdStore.superclass.constructor.call(this, Ext.apply({ storeId: ‘ProdStore’, id:’ProdStore’, url: ‘products.json’, root: ‘proddata’, restful:true, idProperty:’id’, successProperty:’success’, autoLoad:true, autoSave:false, batch:true, writer: new Ext.data.JsonWriter({ encode: false, listful: false, writeAllFields: false}), fields: […]

Sencha Touch Rails 3.1

我正在尝试在rails上加载带有sencha touch的资源,但是我收到以下错误: Started OPTIONS “/menu_items.json?_dc=1322512349038&limit=25&sort=%5B%7B%22property%22%3A%22name%22%2C%22direction%22%3A%22ASC%22%7D%5D” for 127.0.0.1 at 2011-11-28 18:32:29 -0200 ActionController::RoutingError (No route matches [OPTIONS] “/menu_items.json”): 我的商店代码: new Ext.data.Store({ model: ‘MenuItem’, sorters: ‘name’, getGroupString: function(r){ return r.get(‘name’)[0] || “”; }, proxy: { type: ‘rest’, url: ‘http://localhost:3000/menu_items’, format: ‘json’, reader: { type: ‘json’, root: ‘menu_item’ } }, listeners: { load: { fn: this.initializeData, scope: this […]

Font-Awesome ExtJS ActionColumn

我在我的应用程序中使用FontAwesome和ExtJS。 当我这样做时,所有其他按钮工作正常,字体很棒: iconCls: ‘fa fa-edit’ 但是当在actioncolumn中使用相同的配置(允许您将按钮放在网格上的组件)时,图标就不会出现。 有谁知道为什么? 编辑 在尝试了@qdev之后回答:我只是看到了一个?#f040; 呈现的文字(蓝色)。 为操作列按钮生成的HTML: xf040; CSS(取自萤火虫检查员): element.style { font-family: FontAwesome; } *, *:before, *:after { box-sizing: border-box; } *, *:before, *:after { box-sizing: border-box; } .x-action-col-icon { cursor: pointer; height: 16px; width: 16px; } .x-border-box, .x-border-box * { box-sizing: border-box; } .x-action-col-glyph { color: #9bc8e9; font-size: 16px; line-height: […]

Sencha似乎不喜欢Rails的json

我有一个Rails控制器,它将一些模型呈现给json。 @events = Event.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @events } format.json { render :json => { :results => @events } } end 输出如下: { “results”: [ { “name”:”test”, “created_at”:”2011-03-23T13:32:57Z”, “latitude”:60.0, “location”:null, “updated_at”:”2011-04-14T16:38:54Z”, “id”:1, “longitude”:30.0, “takes_place_at”:”2011-03-23T13:32:00Z” }, { “name”:”x”, “created_at”:”2011-03-23T13:36:44Z”, “latitude”:60.0, “location”:null, “updated_at”:”2011-03-23T13:36:44Z”, “id”:2, “longitude”:30.0, “takes_place_at”:”2011-03-23T13:36:00Z” }, { “name”:”Gruempi”, […]

Watir webdriver和extjs寻找元素

我正在使用使用ruby的watir-webdriver进行验收测试我想问一下watir webdriver是否支持ExtJs? 我试图找到由ExtJS动态生成的元素。 我正在尝试做一些事情 @browser = Watir::Browser.new :chrome #Some step go to page @cbo = @browser.execute_script “return Ext.getCmp(‘cboCategory’)” 但它不起作用请给我一些建议。 谢谢。

Sencha touch应用程序加载器一直闪烁

我刚刚设置了一个基本的sencha触摸应用程序。 sencha generate app *Name* *Directory* 。 该应用程序生成没有任何错误,但当我启动服务器并在Chrome中加载应用程序(刚刚更新到最新版本)时,我得到一个蓝色的屏幕,有三个闪烁的点。 在JS控制台中,有这样的: 未捕获的TypeError:对象[object Object]没有方法’append’“,发生在sencha-touch.js中 这是一个常见问题吗? 我做错了什么吗? 该应用程序使用sencha touch 2.2.1和ruby 1.9.3生成。