extjs-mvc

Render customize component inside XTemplate

白昼怎懂夜的黑 提交于 2019-12-13 12:23:01
问题 Ext.define('GB.view.DigestList',{ extend: 'Ext.panel.Panel', alias:'widget.digestlist', items:[ { xtype:'dataview', store: 'GB.store.Digests', tpl: new Ext.XTemplate( '<tpl for=".">', '<div class="container">', '{name}', '<div class="davidfun"></div>', '</div>', '</tpl>' ), listeners: { viewready: function(){ var home_d = Ext.create('GB.view.MyOwnDigest'); home_d.render(Ext.query('.davidfun')[0]); // home_d.render(Ext.getBody()); <- it'll work fine with this line }, } }], bind: function

Browser History with ExtJS MVC

北慕城南 提交于 2019-12-13 06:23:58
问题 I am looking for an example of ExtJs MVC which supports browser history. The example they have on the Sencha site here is not MVC based. The other one I found here uses dynamically loaded views and controller. I imagine the solution is a combination of the 2 approaches. Wondering if anyone has a ready example that I can refer to? 回答1: I managed to put together an example by combining the approaches from the 2 links above. Here is the jsfiddle with the ext js script: http://jsfiddle.net

change the html from controller in extjs

孤人 提交于 2019-12-12 06:25:59
问题 In my Extjs 4.1.1a project, Fiddle ( this fiddle is not working, it is just for reference ) I am changing the HTML(In controller) value using Ext.apply(weekNotifications,{html: {"hello"}); But the page(view) is not updating. When I checked the variable weekNotifications in Chrome console, after the above function, the innerHTML is "hello" as I added but in weekNotifications.el.dom.innerHTML is "Notifications here" (old text). I even tried: weekNotifications.update("Hello"); //same problem as

Sencha touch: Error-" The following classes are not declared even if their files have been loaded: 'Ext.panel'

ぃ、小莉子 提交于 2019-12-12 04:55:28
问题 I have just started with sencha touch,really impressed with sencha documentation and its native feel. I was trying out this link. But i got error in between and i got this error in console "The following classes are not declared even if their files have been loaded: 'Ext.panel'. Please check the source code of their corresponding files for possible typos: 'touch/src/panel.js". i am new to MVC framework so i am not able to find where i went wrong. And is it necessary to get good knowledge of

Using BoundList as widget

落花浮王杯 提交于 2019-12-12 03:43:02
问题 I have an extended bound list, and I use it as a widget. Get/set value and other works good, but: How can I add a field label before it? Example of set value: setValue: function (v) { this.value = v; // TODO select selected var sm = this.getSelectionModel(); var store = this.getStore(); var rec = store.findRecord(this.valueField, v); sm.select(rec); }, Can you help me? Or is the only solution that I have to put this bounding list in a panel? 回答1: The easiest way to get around this is to put

How to refer the store in Controller --> Code.js file?

╄→гoц情女王★ 提交于 2019-12-12 03:29:12
问题 I am storing the JSON format in to Code.js of store folder. 'store' folder --> Code.js Ext.define('LoginPage.store.Code', { extend: 'Ext.data.Store', model: 'LoginPage.model.Code', autoLoad: true, proxy: { type: 'ajax', api: { read: 'data/loginResponse.json', update: 'data/checkCredentials.json' //contains: {"success": true} }, reader: { type: 'json', root: 'login', successProperty: 'success' } } }); 'model' folder --> Code.js Ext.define('LoginPage.model.Code', { extend: 'Ext.data.Model',

Add tip text dynamically to a slider

对着背影说爱祢 提交于 2019-12-12 02:06:51
问题 In my project, I am trying to add the tip text (config) dynamically to a slider. How to do that? I need to add it dynamically because I am generating the array of variables in a "Controller", which holds the text for each value of the slider (for tip text). var slider = Ext.getCmp('slider') slider.setTipText(arrayOfVariables) //What should I do here instead? There is no such method like setTipText in docs. What should I use then? EDIT : { xtype:'slider', animate: false, //plugins: [Ext.create

Extjs 4 dateField getValue

百般思念 提交于 2019-12-11 20:33:12
问题 I feel should be easy but still does not work, "toDate.getValue();" does not return Ext.date object. I cannot format date. Error: format is undefined. Below is my form field. var toDate = new Ext.form.DateField( { fieldLabel: "date" value: new Date(), name: "abs-to-date", width: 100, allowBlank: false } And on submission of form, i want to format date. var toDateTime = toDate.getValue(); console.log(toDate.getValue()); toDateTime.setHours( toHour.getValue(), toMinute.getValue(), 0 ); abs.to =

ExtJS 4 problems with form updating a new created record in a store - loadRecord updateRecord

蓝咒 提交于 2019-12-11 14:14:27
问题 I have problems with a form saving to a store. The form loads a record for editing a existing record, or is blank for a new record. Editing a existing record works fine. Creating a new one works fine as well. I get problems if I want to edit & update a newly created record without closing and re-opening the form. I guess the problem is that the id of the record inside the store is assigned through the remote server. The form is holding a copy of the model and is not taking any notice of the

Select a value from a variable

和自甴很熟 提交于 2019-12-11 13:04:51
问题 In Extjs, I am trying to select a value accrued from a variable Store . I tried: var newStore = Store.data.items[0].data.accrued; The above one is not working. I am getting error: Uncaught TypeError: Cannot read property 'data' of undefined Whenever I add items[0] , it is making the variable undefined. When I checked: var newStore = Store.data.items.length; output is: 0 //? But I can see that there are items in Store variable here as shown in the above image. Anyway, I just want to get the