mardi 30 septembre 2014

[CLOSED] Error: Cannot add destroyed item



  1. Looks like we can't reproduce the issue or there's a problem in the test case provided.










  2. Default







    You're declaring the editor as an instance which means it will be shared across all classes. The first time you close the window the editor will be destroyed.

    Code:



    editor: {
    xtype: 'combo',
    // Other stuff
    }

    This applies to all things across the framework. You should almost never use new Foo() or Ext.create('Foo') when defining a class.






    Evan Trimboli

    Sencha Developer

    Twitter - @evantrimboli

    Don't be afraid of the source code!













[CLOSED] Error: Cannot add destroyed item

App plaftorm on ExtJS 4.2 and node.js/node-webkit

http://ift.tt/1v39ZlS

After reading this great walkthrough i finally could see how to put together a mutiuser platform for desktop-like office applications based on node.js/node-webkit as backend. It uses only senchalab's `connect` v2.9 and simplest JSON back-and-forth under Ext.data.Store contract (there's no ext.direct&stuff).


App modules in MDI for one particular task or functionality. For example there are CarTracker and MVC FeedViewer modules. Also there are authentication using RBAC and simple chat app. All this can be a better path away from MS Excel/VBA or Delphi (and such).


Live demo (users: dev, admin, test, utest with one password: pass) http://ift.tt/1ubPPbe






App plaftorm on ExtJS 4.2 and node.js/node-webkit

Sluggish performance of SA 3.0.1

Hey guys, I'm currently using Sencha Architect 3.0.1-stable to create an ExtJS 4.4.2 project with about 150 views. However, the performance now is very sluggish and it takes a few seconds to get the code view loaded. What more when typing, there is a 1-3 seconds delay before the typed words actually appear. I'm on Windows 7 64 bit with 8gb ram. Currently only have Tomcat service turned on, Google Chrome and Sublime Text.

Also tried to run my project on the latest Sencha Architect 3.1 and there were no difference..


Would love to know how to improve the architect's performance..


Thanks






Sluggish performance of SA 3.0.1

Combo in DD grid reverts to value on blur



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default Combo in DD grid reverts to value on blur



    Combo in DD grid reverts to value on blur





    See the following fiddle.

    http://ift.tt/1nHPzQO


    Drag the row into the right-hand grid and then set the "String Type" in the combo. It will display the name correctly. However when you click anywhere outside the combo changes to the value. This does not seem like normal combo behavior.















Combo in DD grid reverts to value on blur

Accessing multipul dimensions of an ajax request

Greetings all! I've got api that generates JSON for me to consume in extjs. I've got a model set up for the fields

Code:



fields: [
{
name: 'UNID'
},
{
name: 'MIN_IN_STAT'
},
{
name: 'UNIT_STATUS'
},
{
name: 'NUM_1'
},
{
name: 'CDTS'
}
]

but I'd like to access data being passed at a higher level of the response than that. My new response is structured like so:


Code:



{"totalCount":"9","totalServiceClosed":"3","totalTroubleClosed":"0","Events":[{"UNID":"79607","MIN_IN_STAT":0.0,"UNIT_STATUS":"ER","NUM_1":"005195652","CDTS":"20140930160716CD"},{"UNID":"79607","MIN_IN_STAT":1.0,"UNIT_STATUS":"AR","NUM_1":"005195652","CDTS":"20140930160720CD"},{"UNID":"79607","MIN_IN_STAT":1.0,"UNIT_STATUS":"AM","NUM_1":"005195652","CDTS":"20140930160830CD"},{"UNID":"79607","MIN_IN_STAT":1.0,"UNIT_STATUS":"ER","NUM_1":"005195660","CDTS":"20140930160902CD"},{"UNID":"79607","MIN_IN_STAT":5.0,"UNIT_STATUS":"AR","NUM_1":"005195660","CDTS":"20140930161015CD"},{"UNID":"79607","MIN_IN_STAT":1.0,"UNIT_STATUS":"AM","NUM_1":"005195660","CDTS":"20140930161542CD"},{"UNID":"79607","MIN_IN_STAT":3.0,"UNIT_STATUS":"ER","NUM_1":"005201747","CDTS":"20140930161625CD"},{"UNID":"79607","MIN_IN_STAT":3.0,"UNIT_STATUS":"AR","NUM_1":"005201747","CDTS":"20140930161923CD"},{"UNID":"79607","MIN_IN_STAT":0.0,"UNIT_STATUS":"AM","NUM_1":"005201747","CDTS":"20140930162208CD"}]}

I'd like to take the totalServiceClosed and totalTroubleClosed and just throw them into a variable once the ajax request is loaded, but I don't know where to look to access the info. I tried to add another reader, but Sencha Architect isn't letting me. Any help or direction is very much appreciated! Thanks!

EXTJS 4.2.3 w/Sencha Architect 3.0.4.1386




Accessing multipul dimensions of an ajax request

[5.0.1] Grid Filters plugin causing store to load twice



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default [5.0.1] Grid Filters plugin causing store to load twice



    [5.0.1] Grid Filters plugin causing store to load twice





    Fiddle:

    http://ift.tt/1oweSAb

    Issue:

    Adding the "gridfilters" plugin to a grid causes the grid's store to load twice


    Expected:

    The store to load once


    Recreate:

    Load the fiddle, open a console. You will see "load" printed twice after running. Behavior still shows in current nightly.















[5.0.1] Grid Filters plugin causing store to load twice

Sencha Design Query

Hello,

I was very new to Sencha and I had some clarifications which I thought would be better if I share at this forum.


Query is : I have a current web application in place to provide me data in a list which is built using java and ui is built using jsp. I want to design a mobile app in Sencha to perform the same task and simultaneously want it in desktop using Sencha/ExtJs.


Now I am confused in following manner :


1. Do I need to create separate applications for web app and mobile app?


2. For the web app I need to load a separate set of files whereas for the mobile app it is different. If the application is one then can I do this?


3. Also, all the java files which I am using for the getting the list data, should be in same code base or separate?


Please help me on this.


Thanks in advance..






Sencha Design Query

[Ext 5.0.1] TreeStore need help

Hi everybody,

I'am trying to use extjs 5 instead of extjs 4.2 for my new project.

I already built a treepanel with extjs 4.2 in this project and now i don't understand how it works in extjs 5 or what i did wrong in extjs 4. I tried to find something to help me since one week but i failed.


My problem is i can't populate my treepanel with my treestore by a json request.

The request is loaded but i think the data doesn't go in the store (storeTree.getCount() return 0).

I replace the root by a rootProperty but i think it's not enough.


I show you the code:



Code:



var storeTree = Ext.create('Ext.data.TreeStore', {
model: 'ArboModel',
root: {
id: 1
},
defaultRootId: '',
proxy: {
type: 'ajax',
reader: {
type: 'json',
rootProperty: 'root'
},
url: url
},
lazyFill: true
});


storeTree.load({
params: {
node: 'root'
}
});
storeTree.on('load', function () {
// console.log(storeTree);
alert(storeTree.getCount());
});

The request returns me this JSON:


Code:



{"root":[{"children":[{"class":"models.Folder","entityId":2,"id":2,"idDoc":null,"leaf":false,"persistent":true,"text":"DRH"}],"class":"models.Folder","entityId":1,"id":1,"idDoc":null,"leaf":false,"persistent":true,"text":"UNILEVER"}]}



My tree panel :

Code:



var treeArboEnterpriseTree = Ext.create('Ext.tree.Panel', {
title: 'Arborescence',
width: 300,
flex: 1,
height: 250,
xtype: 'treegrid',
store: storeTree,
rootVisible: false,
collapsible: true
});

And my model :

Code:



Ext.define('ArboModel', { extend: 'Ext.data.TreeModel',
idProperty :'id',
fields: [
{
name: 'id',
type : 'int'
},{
name: 'leaf',
type : 'boolean'
}, {
name : 'libelle',
type : 'string'
},{
name : 'text',
type : 'string'
},{
name : 'children'
},{
name : 'idDoc',
type : 'int'
}
]
});

I don't know how to use 'idProperty' in the model, how to config my treepanel, and how to config the treestore.

Thank you for helping !


Pierre






[Ext 5.0.1] TreeStore need help

Date picker does not work correctly inside a window in a desktop



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default Date picker does not work correctly inside a window in a desktop



    Date picker does not work correctly inside a window in a desktop





    Hello, I need to use a date picker in a window insise the desktop but it does not work. It appears but when I click in the month button the style seems broken and I can not work with it.

    How to reproduce


    In ExtJS 5.0.1 ,edit the GridWindow.js inside the desktop example and add a date picker in the tool bar:



    Code:



    {
    xtype: 'datefield',
    fieldLabel: 'Date of Birth',
    name: 'dob',
    allowBlank: false,
    alwaysOnTop : true,
    maxValue: new Date()
    }

    After the change you will get a result like in the picture in Chrome and Firefox:

    datepicker_bug_extjs5.PNG


    I hope you can help me with this. Thank in advance.


    Regards.















Date picker does not work correctly inside a window in a desktop

Easy One - Small working snipit to improve

The following snip of code is working great, but how would I get the grid without using getCmp and what else is done poorly? It is the onExpandBody function usingRowExpander in 4.2.3 in Architect (Grid promoted to a class and the onExpandBody is in the controller). Most of it is obviously developed from looking at a thousand examples:

onExpandBody: function(rowNode, record, expandRow) {

var containerName = "OrderRow" + record.get('OrderNumber'),

grid = Ext.getCmp ('grdOrders'); //go up from the node?




// See if the panel already exists from a previously expanded row and kill it.

var oldPanel = Ext.getCmp('pnlOrderRow');

if (oldPanel !== undefined) {

oldPanel.destroy();

}




// Collapse the prevoiusly expanded row

if (this.lastExpandedRowIdx !== undefined && this.lastExpandedRowIdx !== rowNode.rowIndex){

var rowex = grid.getPlugin('OrdersRowExpander');

var row = Ext.get(rowex.view.getNode(this.lastExpandedRowIdx));

row.addCls(rowex.rowCollapsedCls);

}




// store the currently expanded row index

this.lastExpandedRowIdx = rowNode.rowIndex;




// Create the panel inside the row

var holderPanel = Ext.create("SalesOrderHistory.view.pnlOrderRow");

holderPanel.render(containerName);

// I don't know why I have the following line

holderPanel.getEl().swallowEvent(['mouseover', 'mousedown', 'click', 'dblclick']);




// Load all the sotres on the details panel

var newURL = baseURL + 'jsonWeb.p?mode=OrderLines&orderNo=' + record.get('OrderNumber') +

'&SessionToken=' + SessionToken;

var ds = Ext.getStore('strOrderLine');

ds.proxy.url = newURL;

ds.load();




},






Easy One - Small working snipit to improve

Scheduler events rendering problem

Hi guys

I have a problem. I changed datastore(in-Memory) of sample Scheduler (Calendar) demo to Ajax-store, I changed CalendarMappings properly, so store is loaded with right records I can see it in debugger, but on main panel renders only one event in a day. If there is one event everything looks great, but if I add another events CalendarPanel shows only one per day.


I cant understand where source of the problem






Scheduler events rendering problem

Binded selection prevents from entering edit mode



  1. Thank you for reporting this bug. We will make it our priority to review this report.





  2. Sencha User



    Join Date

    Jun 2014


    Location

    Murmansk, Russia


    Posts

    41


    Vote Rating

    1













Binded selection prevents from entering edit mode

Multiple explicit formula deep binds failing.



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default Multiple explicit formula deep binds failing.



    Multiple explicit formula deep binds failing.





    The following View Model formula works perfectly fine:


    Code:



    formulas: {
    recordDirty: {
    bind: {
    bindTo: '{someRecord}',
    deep : true
    },
    get: function(record) {
    return record.dirty;
    }
    },
    }



    However if you try to deep-bind 2 records (or other object), it is currently not possible and will result in invalid data passed to the getter:

    Code:



    formulas: {
    twoRecordsDirty: {
    bind: {
    recordA: {
    bindTo: '{someRecord}',
    deep : true
    },
    recordB: {
    bindTo: '{anotherRecord}',
    deep : true
    },

    },
    get: function(records) {
    return recordA.dirty || recordB.dirty;
    }
    },
    }








    Last edited by Artur Bodera (Joust); Today at 3:10 AM.


    Reason: because of this archaic forum software breaks my markup every single time ...











Multiple explicit formula deep binds failing.

Populate combobox after another

I've two combobox in a form page. I receive the data to populate my first combobox. Basicly my first combobox will have a list of tables from SQL Server. My second combobox must have the list of columns which a table has.


I've already made two services which are working to give me the data that I need. The thing is I'm failing to populate the second combo box, right after I select the first one. Any ideias?



Code:



onNewEntityClick: function (button, model) {
var store = button.up('backendpanel').down('settingsgrid').getStore();
var instance = button.up('backendpanel').down('instanceform');


instance.setVisible(true);
instance.setTitle('New Map');


var checkDirty = function (field) {
if (field.isDirty() && instance.isEdit && instance.canSave) {
instance.saveButton.enable();
field.addClass('AppDirtyField1');
}
}


instance.store = null;


instance.store = Ext.create('Ext.data.JsonStore', {
fields: ['name', 'inputType', 'propName'],
listeners: {
load: function (store, records, loaded) {

var values = store.proxy.reader.rawData.data;
instance.getForm().setValues(values);
instance.setLoading(false);

instance.add({
bbar: [
{
xtype: 'button', itemID: 'saveButton', text: 'Guardar',
listeners: {
click: function () {
var settingID = button.up('backendpanel').down('settingsgrid').getSelection()[0].data.SettingsID;
Ext.Ajax.request({
url: 'Services/SaveInstance.ashx',
method: 'POST',
params: {
id: settingID,
data: instance.getValues(true, false, false, true)
},
success: function (response, opts) {
//update ui
var intancesStore = button.up('backendpanel').down('entitiesgrid').getStore();
intancesStore.getProxy().setExtraParam('id', settingID);
intancesStore.load();
instance.setVisible(false);
}
});
}
}
},
{
xtype: 'button', itemID: 'deleteButton', text: 'Apagar',
listeners: {
click: function () {
instance.getForm().reset();
instance.update();
}
}
}
]
});
},
metachange: function (store, meta) {
instance.removeAll();
Ext.each(meta.fields, function (field) {
switch (field.inputType) {
case 1:
instance.add({
xtype: 'textfield',
labelSeparator: '',
labelWidth: 110,
inputWidth: 300,
width: 400,
fieldLabel: field.name,
name: field.propName,
enableKeyEvents: true,
listeners: { dirtychange: checkDirty }
});
break;


case 2:
var field = Ext.create('SGS.view.field.Checkbox', {
labelSeparator: '',
labelWidth: 110,
fieldLabel: field.name,
name: field.propName,
listeners: { dirtychange: checkDirty }
});

instance.add(field);
break;
case 3:
var comboStore = null;
//if (values[record.data.propName]) {
comboStore = Ext.create('Ext.data.Store', {
fields: ['ID', 'Name', 'isChecked'],
data: field.values
});
//}
console.log(comboStore);
var comboboxField = Ext.create('SGS.view.field.ComboBox', {
listeners: {
select: function(combo, record, index) {
var comboStore = null;
// var settingID = button.up('backendpanel').down('settingsgrid').getSelection()[0].data.SettingsID;
Ext.Ajax.request({
url: 'Services/DBSourceService.ashx',
method: 'POST',
params: {
id: record[0].data.ID
},
/*success: function (response, opts) {
//update ui
var intancesStore = button.up('backendpanel').down('entitiesgrid').getStore();
intancesStore.getProxy().setExtraParam('id', settingID);
intancesStore.load();
instance.setVisible(false);
},*/
})
/*comboStore = Ext.create('Ext.data.Store', {
fields: ['ID', 'Name', 'isChecked'],
data: field.values
});
console.log(comboStore);
var comboboxField = Ext.create('SGS.view.field.ComboBox', {
cls: 'ACombo2',
labelSeparator: '',
labelWidth: 110,
width: 400,
fieldLabel: field.name,
name: field.propName,
displayField: 'Name',
valueField: 'ID',
forceSelection: true,
editable: false,
store: comboStore
});
if (comboStore != null) {
var selected = null;
Ext.each(comboStore.data.items, function (item) {
if (item.data.Checked) { selected = item; }
});

if (selected) comboboxField.select(selected);
}
comboboxField.addListener('select', checkDirty);
instance.add(comboboxField);*/
}
},
cls: 'ACombo2',
labelSeparator: '',
labelWidth: 110,
width: 400,
fieldLabel: field.name,
name: field.propName,
displayField: 'Name',
valueField: 'ID',
forceSelection: true,
editable: false,
store: comboStore
});

if (comboStore != null) {
var selected = null;
Ext.each(comboStore.data.items, function (item) {
if (item.data.Checked) { selected = item; }
});

if (selected) comboboxField.select(selected);
}
comboboxField.addListener('select', checkDirty);
instance.add(comboboxField);
break;
case 4:
var unselectedData = [];
var selectedData = [];
Ext.each(values[record.data.propName], function (entry) {
if (entry.Checked) {
selectedData.push(entry);
} else {
unselectedData.push(entry);
}
});

var optionsStore = new Ext.data.Store({
fields: ['ID', 'Name', 'isChecked'],
data: unselectedData
});

var selectedStore = new Ext.data.Store({
fields: ['ID', 'Name', 'isChecked'],
data: selectedData
});

var field = Ext.create('SGS.view.field.MultiSelect', {
fieldLabel: record.data.name,
name: record.data.propName,
border: false,
optionsStore: optionsStore,
selectedStore: selectedStore,
listeners: { dirtychange: checkDirty }
});

instance.add(field);
break;


case 5:
instance.add({
xtype: 'textfield',
inputType: 'password',
labelSeparator: '',
labelWidth: 110,
inputWidth: 300,
width: 400,
fieldLabel: field.name,
name: field.propName,
enableKeyEvents: true,
listeners: { dirtychange: checkDirty }
});
break;
}
});
}
},

proxy: {
type: 'ajax',
url: 'Services/FormService.ashx',
reader: {
type: 'json',
rootProperty: 'data', successProperty: 'success'
//root: 'items'
}
},
});



instance.store.load({
params: {
id: button.up('backendpanel').down('settingsgrid').getSelection()[0].data.SettingsID,
type: button.up('backendpanel').down('settingsgrid').getSelection()[0].data.Value
}
});
},





Populate combobox after another

Resource interpreted as Image but transferred with MIME type



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default Resource interpreted as Image but transferred with MIME type



    Resource interpreted as Image but transferred with MIME type





    Full code given at the end of post works.

    But when I change


    Code:



    items : [cardsList, card]

    to


    Code:



    items : [cardsList, img]

    then I get error from the title.

    So basically I have to put Ext.Img inside Ext.Container

    Code:



    Ext.setup({

    onReady : function() {

    //CONFIGURE DATA STORE.=====================================

    //REGISTER DATA MODEL.
    Ext.regModel(
    'cardsModel', //Model name
    { fields : ['name', 'path'] } //Column names
    );

    //CREATE READER. JSON TYPE.
    var cardsReader = Ext.create("Ext.data.reader.Json", {
    rootProperty : "cards"
    });

    //CREATE PROXY.
    var peopleProxy = Ext.create("Ext.data.proxy.Ajax", {
    url : "cards.json",
    reader : cardsReader
    });

    //CREATE DATA STORE.
    var cardsStore = new Ext.data.Store({
    model : 'cardsModel',
    proxy : peopleProxy,
    autoLoad : true
    });

    //CONFIGURE VIEWS.===========================================

    //CREATE CARD VIEW.------------------------------------------
    var img = Ext.create('Ext.Img', {
    src : 'IMAGES/GROUP 1/BLACK GIANT.png',
    listeners : {
    tap : function (list, index, item, record) {
    view.setActiveItem(0);
    }
    }
    });

    var card = Ext.create('Ext.Container', {
    layout : 'fit',
    title : 'CARD',
    items : [img]
    });

    //CREATE LIST VIEW.------------------------------------------
    var cardsList = Ext.create('Ext.dataview.List', {

    //PROPERTIES
    title : 'SELECT CARD',
    itemTpl : '{name}',
    store : cardsStore,

    //LISTENERS
    listeners : {
    select : function (list, index, item, record) {
    var name = index.data.name;
    var path = index.data.path;
    img.setSrc('IMAGES/' + path + '/' + name + '.png');
    view.setActiveItem(1);
    }
    }

    });

    //CREATE CARD LAYOUT CONTAINER TO HOLD THE ABOVE VIEWS.-------
    var view = Ext.create('Ext.Container', {
    fullscreen : true,
    layout : 'card',
    items : [cardsList, card]
    });

    }


    });














Resource interpreted as Image but transferred with MIME type

setMasked don't work on iPhone

Hello,

I'm creating an app, that load dynamically items on a store.

During the load I push the masked view on Viewport.

It's working when I'm trying the app on Firefox Browser, but when I try on my iphone, there is nothing masked view...


On the main.js I've add two functions :



Code:



function mask(texte) {
Ext.Viewport.setMasked({
xtype: 'loadmask',
message: texte
});
}
function unmask() {
Ext.Viewport.unmask();
}

And I call them inside other functions on main.js :


Code:



function schedule(ladate) {
mask('Loading...');
start = new Date();
....
unmask();
}

I've tried to set loadmask in the view like this :


Code:



itemTpl: new Ext.XTemplate(
...
),
masked: {
xtype: 'loadmask',
message: 'Loading...'
},

But it's always work on Firefox, not on iPhone...

How can I do this please ?



setMasked don't work on iPhone

lundi 29 septembre 2014

[Q] How to get stateful accordion to work?

Hi gurus

ExtJS 4.2.2


I have this simple portal that is supposed to work as an entrance to a number of custom made database tools.


I want the front page to be an accordion layout and I want it to be stateful so that it remembers the users last choice.


But I can't get it to work :-( Below's the single item in my viewport. Can anyone explain to me why the first of my three accordion items always renders as expanded and the two others collapsed?


Thanks in advance



Code:



{
xtype: 'panel',
padding: '100px 0 0 0',
border: false,
stateful: true,
stateId: 'toolsPanel',
layout: {
type: 'hbox',
align: 'center',
pack: 'center'
},
flex: 1,
items: [{
xtype: 'panel',
align: 'center',
border: false,
width: 600,
height: 500,
stateful: true,
stateId: 'toolsAccordion',
layout: {
type: 'accordion',
titleCollapse: false,
animate: true,
activeOnTop: true,
hideCollapseTool: true
},
defaults: {
layout: {
type: 'vbox'
},
overflowY: 'auto'
},
items: [
{ xtype: 'oracleToolsPanel', stateful: true, stateId: 'oracleTools' },
{ xtype: 'sqlServerToolsPanel', stateful: true, stateId: 'sqlserverTools' },
{ xtype: 'db2ToolsPanel', stateful: true, stateId: 'db2Tools' }
]
}]
}





[Q] How to get stateful accordion to work?

Sencha Architect 3.1 support for Sencha Touch 2.4

[unable to retrieve full-text content]Hello, I've upgraded my project from Sencha Architect 3 to 3.1. But unable to upgrade the version of Sencha Touch to the latest one. Can you...



Sencha Architect 3.1 support for Sencha Touch 2.4

How to achieve double grouping

Hi ST Forum members,

It's my first time using Sencha Touch and I'm not familiar with it's architecture, so I thought about asking experienced people to guide me to achieve my goal and to use the best approach that follow the ST best practice.


My goal is to display a list of meals with those properties: name, date, period(lunch or dinner).


I want to show all meals of the same day in a carousel so first item of carousel will be for example Sunday next item will be monday .....


And in each day (carousel item) I have the list of meals of this day grouped by the period(dinner and lunch). Please see the image below as it explains more.


iPhone Wireframe.png


I'm confused about how to achieve that especially that I need to group Meals first by date and secondly by period (stores could have only grouping property).


I found the only way to achieve that is to make a specific store foreach day which load meals of one day which is not reliable.


Could any expert or experienced member advice me or guide me to any tips or parts of the ST that will help me.


Thanks a lot.






How to achieve double grouping

Context menu events are broken in latest nightly



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default Context menu events are broken in latest nightly



    Context menu events are broken in latest nightly





    Please use the following fiddle. http://ift.tt/1uxKuMN

    If you right-click the node then click the menu item you can see the handler for the menu item is not called because the menu hide event is called first.


    If you change the Ext version in the fiddle to 5.0.1.1255 you can see the handler works fine.


    Looks like it was broken in the 09/21 nightly















Context menu events are broken in latest nightly

Appended Iframe listeners are not working

I'm relatively new to ExtJS and I'm trying to append an Iframe with listeners to the DOM. But unfortunately the listeners are not working. Both console.logs are not printing anything. What am I doing wrong. I hope someone can help.

My ExtJS Version is 4.2.2.



Code:



Ext.DomHelper.append(container.getEl().dom.id, {
tag: 'iframe',
frameBorder: 0,
width: 0,
height: 0,
css: 'display:none;visibility:hidden;height:0px;',
src: urls[y],
listeners: {
afterrender: function () {
console.log('rendered');
this.getEl().on('load', function () {
console.log('loaded');
});
}
}
}

Kevin



Appended Iframe listeners are not working

SA 3.1 build 1903 - upgrade app from 3.0.4

[unable to retrieve full-text content]In SA 3.0.4 all this operation work correctly, not in SA 3.1.0 build 1903: 1) css and style not work 2) can't build ios pachage 3) can't modify...



SA 3.1 build 1903 - upgrade app from 3.0.4

CMD v5.0

[unable to retrieve full-text content]*command:* sencha phonegap remove *response:* Sencha Cmd v5.0.1.231 [ERR] Unknown command: "remove" This is not good!



CMD v5.0

How do I get data from a store which uses a model with HasMany lists?

Hello folks:

I'm trying to view data in a model via a JSON proxy which has several list in it.


My model looks like this:



Code:



Ext.define('PeakDay.model.MainGridModel', {
extend: 'Ext.data.Model',

requires: [
'Ext.data.Field'
],


hasMany: [
{
name: 'cisoSystemLoadModelList',
model:'CISOSystemLoadModel',
associationKey:'cisoSystemLoadModelList'
},
{
name: 'interchangeAtPeakModelList',
model:'InterchangeAtPeakModel',
associationKey:'interchangeAtPeakModelList'

},
// and so on

My JSON looks like this:


Code:



{
"cisoSystemLoadModelList": [
{
"sortOrder": 0,
"title": "Peak Demand",
"mw": "38,712",
"time": "16:55",
"asOfTime": "5/29/2014 2:25:58 PM",
"groupName": ""
},
{
"sortOrder": 1,
"title": "Minimum Demand",
"mw": "22,942",
"time": "3:47",
"asOfTime": "5/29/2014 2:25:58 PM",
"groupName": ""
},
{
"sortOrder": 2,
"title": "Scheduled Load",
"mw": "32,516",
"time": "84%",
"asOfTime": "5/29/2014 2:25:58 PM",
"groupName": ""
},
{
"sortOrder": 3,
"title": "Pump Load",
"mw": "290",
"time": "",
"asOfTime": "5/29/2014 2:25:58 PM",
"groupName": ""
}
]
}

In my controller I make a call to the proxy and I do get a successful callback

Code:



var mainGridSheetStore = Ext.StoreMgr.lookup('MainGridSheetStore');

var queryDate = 'TODAY';
mainGridSheetStore.load({
params: { 'queryDate': queryDate },
callback: function(records, operation, success) {
if (success) {
var mainGridSheetStore = Ext.StoreMgr.lookup('MainGridSheetStore');
var mainGridModel = mainGridSheetStore.data.first();
var cisoStore = mainGridModel.data.cisoSystemLoadModelList;
// and so on

I can get the store, I can get the model from the first piece of data in the store. Now I want to get the store with the cisoSystemLoadModelList from that model. The mainGridModel comes back non-null but the data attribute seems to be empty. How can I get a reference to that data?

Thank you


Greg






How do I get data from a store which uses a model with HasMany lists?

ComboBox value binding change



  1. Thank you for reporting this bug. We will make it our priority to review this report.





  2. Sencha Premium Member



    Join Date

    Jun 2014


    Posts

    17


    Vote Rating

    0













ComboBox value binding change

'Building a Login App' - Question

I just noticed that there is a new guide describing one method of creating a login front-end to an Ext JS application. I'm currently in the process of trying to move an Ext JS 3.x app to use Ext JS 5 and this guide is useful. I do have a question about this example, however. One thing I would like to be able to do with our application is to only download the full application code base to the users browser once they have logged on.

It seems that the implementation presented in this guide only handles switching from a non-logged on view to a logged on view, but it seems that if you have a large application the code for the entire application is going to be loaded onto the users browser. In our current Ext JS 3.x implementation, we use a JSP page to load a small application containing just the login code and once the user has been validated with refresh the page which loads the full application. When I tried to port this logic to Ext JS 5 I found myself stymied by the build process which wants to bundle everything together. It would be nice to have an example of a way to deal with application login where the main application code isn't loaded until the user is authenticated.


Thanks.


Jim






'Building a Login App' - Question

How to discard suspended events

Combo with emptyText breaks during selection



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default Combo with emptyText breaks during selection



    Combo with emptyText breaks during selection





    Ext version tested:

    • Ext ext-5.0.3-20140925 nightly build


    Browser versions tested against: DOCTYPE tested against: Description:

    • When I try to select a value from combobox I get the error "value is not defined" but only if I set some value inside the "emptyText" param. Without emptyText it works!


    Steps to reproduce the problem:

    • Run this code with 28th sept. nightly build 5.x version and select some option from select.

      Removing the emptyText param it will work


    NB: this code works with 5.0.1 version

    Code:



    Ext.application({
    name : 'Fiddle',


    launch : function() {

    Ext.create('Ext.form.Panel', {

    layout: {
    type: 'vbox',
    align: 'stretch'
    },

    defaults: {
    xtype: 'fieldset',
    defaults: {
    labelSeparator: '',
    labelAlign: 'top'
    }
    },


    items: [
    {
    title: 'test fieldset',
    layout: {
    type: 'vbox',
    align: 'stretch'
    },
    items:[
    {
    xtype: 'combobox',
    name: 'myTest',
    store: [[0,1], [2,2]],
    emptyText: 'my test'
    }
    ]
    }
    ],

    renderTo: Ext.getBody()
    });
    }
    });

    You should get this error

    Uncaught ReferenceError: value is not defined ext-all-debug.js:142211

    Ext.define.updateValue ext-all-debug.js:142211

    Ext.define.onValueCollectionEndUpdate ext-all-debug.js:142001

    Ext.define.doFire ext-all-debug.js:13247

    Ext.define.fire ext-all-debug.js:13108

    Ext.define.doDispatchEvent ext-all-debug.js:13815

    Ext.define.dispatchEvent ext-all-debug.js:13795

    Ext.define.doFireEvent ext-all-debug.js:14375

    Ext.define.fireEventArgs ext-all-debug.js:14338

    Ext.define.notify ext-all-debug.js:51024

    Ext.define.endUpdate ext-all-debug.js:49791

    Ext.define.splice ext-all-debug.js:50506

    Ext.define.remove ext-all-debug.js:50134

    commit ext-all-debug.js:110863

    Ext.define.onSelectChange ext-all-debug.js:111368

    Ext.define.doDeselect ext-all-debug.js:110876

    commit ext-all-debug.js:110907

    Ext.define.onSelectChange ext-all-debug.js:111368

    Ext.define.doSingleSelect ext-all-debug.js:110919

    Ext.define.doSelect ext-all-debug.js:110754

    Ext.define.onNavigate ext-all-debug.js:110610

    fire ext-all-debug.js:23159

    doFireEvent ext-all-debug.js:23652

    fireEventArgs ext-all-debug.js:23630

    fireEvent ext-all-debug.js:23600

    Ext.define.fireNavigateEvent ext-all-debug.js:111727

    Ext.define.onItemClick ext-all-debug.js:111523

    fire ext-all-debug.js:23159

    doFireEvent ext-all-debug.js:23652

    prototype.doFireEvent ext-all-debug.js:90508

    fireEventArgs ext-all-debug.js:23630

    fireEvent ext-all-debug.js:23600

    Ext.define.processUIEvent ext-all-debug.js:113540

    Ext.define.handleEvent ext-all-debug.js:113477

    Ext.define.doFire ext-all-debug.js:13247

    Ext.define.fire ext-all-debug.js:13108

    Ext.define.doDispatchEvent ext-all-debug.js:13815

    Ext.define.dispatch ext-all-debug.js:45020

    Ext.Base.Base.addMembers.callParent ext-all-debug.js:8166

    Ext.define.dispatch ext-all-debug.js:46517

    Ext.define.doPublish ext-all-debug.js:46607

    Ext.define.publish ext-all-debug.js:46555

    Ext.define.doDelegatedEvent ext-all-debug.js:46749

    Ext.define.onDelegatedEvent ext-all-debug.js:46726

    (anonymous function)













Combo with emptyText breaks during selection

Can you put checkboxes in a multiselect?

I've got a form that contains a multiselect form field.

Is it possible to make the selection a checkbox instead of just coloring the row?


Since it is a form and I'm submitting the form, I didn't want to use the grid if it was possible to get the checkbox look without it.






Can you put checkboxes in a multiselect?

Multiple "Ext.application({...})" calls in app.js in production build folder

App not functional on ios8 device Safari

Wrong constructor call for inherited Grid with locked column



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default Wrong constructor call for inherited Grid with locked column



    Wrong constructor call for inherited Grid with locked column





    Ext version tested:

    • Ext JS 5.0.1.1255

    • Ext JS 5.0.0.970


    Browser versions tested against: DOCTYPE tested against: Description:

    • When using multiple levels of inheritance in grids and giving xtype to each level, a grid with lockable columns calls the wrong constructor for the locked-column subgrid.


    Steps to reproduce the problem:

    • Define two grids with inheritance: Ext.grid.Panel > com.example.One > com.example.Two

    • Give both custom gridpanels an alias

    • instantiate grid Two with at least one locked column


    The result that was expected:

    • initComponent of One and Two are called exactly once, all config options are accessible


    The result that occurs instead:

    • initComponent of One is called two times. For the normal inheritance order of the grids (expected) and for the subgrid containing the locked columns

    • subgrid initialization does not get all config options from original Ext.create call


    Fiddle:


    http://ift.tt/1BuC0Fd

    Look at the console output.

    Output actually is:



    Code:



    Init TestGridOne.
    undefined
    Init TestGridOne.
    aValue
    Init TestGridTwo.
    aValue

    Expected output:


    Code:



    Init TestGridOne.
    aValue
    Init TestGridTwo.
    aValue

    It works, however, if we omit the aliases for the two custom grids.

    http://ift.tt/10cL3PD


    Track-down

    As far as we can see, the problem lies in Ext.grid.locking.Lockable#determineXTypeToCreate

    In case of the subgrid with the non-locked columns always a 'gridpanel' is created. In the case of the subgrid WITH the locked columns there is some special handling here regarding treepanel:



    Code:



    // Treeness only moves down into the locked side.
    // The normal side is always just a grid
    if (!lockedSide) {
    return 'gridpanel';
    }
    xtypes = this.getXTypes().split('/');
    xtypesLn = xtypes.length;
    xtype = xtypes[xtypesLn - 1];
    superxtype = xtypes[xtypesLn - 2];


    if (superxtype !== 'tablepanel') {
    typeToCreate = superxtype;
    } else {
    typeToCreate = xtype;
    }

    This only considers one level of inheritance. With more levels of inheritance always the type of the first ancestor is used. Expectation would be always either 'gridpanel' or 'treepanel', but never a custom type.

    Regards

    David















Wrong constructor call for inherited Grid with locked column

dimanche 28 septembre 2014

How to center TextSprite in DrawComponent

I tried to use setTextAnchor() and setTextBaseline() to align TextSprite,

when my friend notice I used those two method, he think I didn't read API carefully.

Is there a correct or better way to align TextSprite in DrawComponent?



Code:



DrawComponent canvas = new DrawComponent(100, 100);
TextSprite text = new TextSprite("110");
text.setTextAnchor(TextAnchor.MIDDLE);
text.setTextBaseline(TextBaseline.BOTTOM);
text.setFontSize(50);
text.setX(50); // half of canvas width;
text.setY(67.5); // half of canvas height + (fontSize * 0.7 / 2);
text.setFill(RGB.BLACK);
canvas.addSprite(text);

About the TextBaseline.BOTTOM and (fontSize * 0.7 / 2):

The position using TextBaseline.TOP and TextBaseline.MIDDLE seems weird,

only the TextBaseline.BOTTOM really makes word's cap height's bottom attach specific y position.

So I use TextBaseline.BOTTOM and fontSize to adjust TextSprite's position.



How to center TextSprite in DrawComponent

MVVM: apply ViewController instance to manually created context menu

Hi everyone

I wanted to add a context menu to an tree panel and use the same ViewController instance for this context menu.


When I created the menu manually via Ext.define, ViewController and ViewModel couldn't be retrieved (Uncaught Error: No method named "onEditClicked" on myApp.view.main.MainController --> my main Controller), so I added them as config of the Menu. It works, but only once because the menu is set as this.view within the ViewController afterwards and that messes everything up.


I figured instead of setting of referencing the instance of the ViewController, I could pass it as a String (like in the View). it works, but it seems like I have two instance of the same ViewController, which is not desired.


So my question: Is it possible to reference to that instance ViewController or do I have to live with 2 instance of the ViewController or rather a Nested Controller with Menu Handlers?


I add a trimmed down version of my code to get you a hint what I'm doing.


My view (where I'm also creating the menu)



Code:



Ext.define('myApp.view.object.ObjectList' ,{
extend: 'Ext.panel.Panel',
requires:['myApp.view.object.ObjectListController', 'myApp.view.object.ObjectListModel'],
alias: 'widget.objectlist',

controller: 'objectlist',
viewModel: {
type: 'objectlist'
},

layout: 'border',

contextMenu : null,

initComponent: function() {
this.items = [{
region : 'west',
split : true,
collapsible : true,
minWidth: 120,
maxWidth: 300,
width: 220,
reference: 'objectlist',
xtype : 'treepanel',
lines : false,
bind : {
store : '{objects}'
},
listeners: {
cellcontextmenu : 'onObjectContextMenu',
containercontextmenu : 'onContainerContextMenu'
},
rootVisible: false
},{
region: 'center',
reference: 'contentpanel'
}];
this.callParent(arguments);
},

showMenu : function( e) {
if( this.contextMenu == null)
this.contextMenu = this.createMenu();
this.contextMenu.showAt(e.getXY());
},

createMenu : function() {
var contextMenu = Ext.create('Ext.menu.Menu', {
reference : 'contextmenu',
viewModel: this.viewModel,
controller: this.controller,
//controller: 'objectlist <--- works, but seemingly with a new instance of the controller
items: [{
text : 'edit',
handler: 'onEditClicked',
bind: {
hidden: '{!menuObject}'
}
},{
text : 'delete',
handler: 'onDeleteObjectClicked',
bind: {
hidden: '{!menuObject}'
}
},{
xtype : 'menuseparator',
bind: {
hidden: '{!menuObject}'
}
},{
text : 'add',
handler: 'onAddDeskClicked'
}]
});
return contextMenu;
}
});

ViewController


Code:



Ext.define('myApp.view.object.ObjectListController', {
extend: 'Ext.app.ViewController',

alias: 'controller.objectlist',

onObjectContextMenu : function( tree, td, cellIndex, record, tr, rowIndex, e, eOpts) {
this.showContextMenu( e, record);

},

onContainerContextMenu : function( tree, e, eOpts) {
this.showContextMenu( e, null);
},

showContextMenu : function( e, menuObject) {
e.preventDefault();
this.getViewModel().set('menuObject', menuObject);
this.getView().showMenu( e);
},)


onEditClicked : function() {
console.log('onEditClicked');
},


onDeleteObjectClicked : function() {
console.log('onDeleteObjectClicked');
},

onAddObjectClicked : function () {
console.log('onAddObjectClicked');
}

});

I'm not even sure if what I'm trying is a good practice or not, so just correct me if I'm doing this completely the wrong way.


thanks in advance!






MVVM: apply ViewController instance to manually created context menu

5.0.2.141 ComboBox 'Uncaught ReferenceError: value is not defined'



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default 5.0.2.141 ComboBox 'Uncaught ReferenceError: value is not defined'



    5.0.2.141 ComboBox 'Uncaught ReferenceError: value is not defined'





    Hello,

    when using nightlyBuild 5.0.2.1411 i got an error when a combobox is used and the value changed.


    I have created the following fiddle:


    http://ift.tt/1BsrY7B


    - please choose a Value and the error 'Uncaught ReferenceError: value is not defined' occurred.


    Michi















5.0.2.141 ComboBox 'Uncaught ReferenceError: value is not defined'

Form error validation with comboBoxes on Multi tab form



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default Form error validation with comboBoxes on Multi tab form



    Form error validation with comboBoxes on Multi tab form





    Hi all,

    when we split a form in multiple tabs with a tabpanel and place a combo on one of them the field dont get loaded and form validate fails when the field has a correct value.


    If we visit all tabs then validation works ok.


    http://ift.tt/1rDa2pR


    To test launch fiddle and click send button to get error.


    If launch fiddle, visit all tabs and click send the form works without problems.















Form error validation with comboBoxes on Multi tab form

non ascii value in select field text

Inserting data to Store with same ID

Subj.

Grid with data inserted with store.add()

BUT: Inserted data can be:

ID,NAME,FIELD1,FIELD2,COUNT

{1,'test','kaka','12345',8}

{2,'test2....}

...

{1, 'test....,,,14}


So, first record with id=1 inserted;

When I insert second record with id=1, it breaks.


So what? How can I (automatically) update data in Store with same IDs to have in result

{1,'test','kaka','12345',22)

except of

{1.... 8)?


is it able using frontend, with no backend use?






Inserting data to Store with same ID

[Ext 5.0.1] Grid cellediting bug (editor moved out of cell)



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default [Ext 5.0.1] Grid cellediting bug (editor moved out of cell)



    [Ext 5.0.1] Grid cellediting bug (editor moved out of cell)





    Screenshot:

    фото.jpg

    As we can see, editor is floating left.


    Without keyboard on screen - no such issue (editor hides)

    Using PC browser (Chrome) - no such issue


    Using Safari on iPad - no such issue



    Code:



    app.framework.version=5.0.1.1255
    app.cmd.version=5.0.2.270














[Ext 5.0.1] Grid cellediting bug (editor moved out of cell)

Scrolling the whole page when only the center panel overflows in border layout?

Hi,

I am using ExtJs 4.2.1 with SA 3.1. I understand that viewport does not provide scrolling, but is there any way/hack to have a scrollbar on the whole webpage instead of center panel when the Center panel overflows in the border layout. I have north, west and center regions in the border layout. Basically, the North region contains the App logo, Center region will be a card layout with most views being form panels. Few long forms overflows the center container and then the scrollbar appears from middle of the page (after the north region ends), and it looks like they aren't part of same webpage.


Is there any solution?


Regards,

Saurav






Scrolling the whole page when only the center panel overflows in border layout?

bulk delete performance issue

Hello,

Using treePanel and removing bulk of nodes is too slow.

E.g: removing 300 selected nodes occurs ~30seconds.


I was wondering, is there is a "bulk node removal" option or other solution (e.g: async removal), which can improve performance issue.


Waiting for your reply..






bulk delete performance issue

Infinite list variable heights image scroll to bottom

mercredi 24 septembre 2014

MemoryProxy + Paging + Filtering doesn't work together

Hello,

I have my store which uses proxy memory. This store is used in grid which contains filtering in columns and pagingtoolbar. When I use only paging everything is fine. I can navigate and value are displayed correctly. But when I use filtering, paging doesn't work any more correctly. I mean it still displays number of total rows insted of number of filtered rows.

For example:

I have 100 rows and page size set to 10, so I see 10 pages. When I set my filter, number of rows decreased to 25 rows, but I still see 10 pages in pagingtoolbar. When I click go to next page paging shows zero records and I cannot use it any more.


Have you got any ideas how I can set up paging and filtering to use it on client side?






MemoryProxy + Paging + Filtering doesn't work together

Column header alignment completly broken when changing column order under hori-scroll

If you scroll to the right, then take the last column to move it to the previous last, the entire layout is completely mixed-up.



Code:



var grid = new Ext.grid.Panel({ title: 'Substation power monitor',
width: 1400,
columns: [{
text: 'Id',
dataIndex: 'id',
width: 520
}, {
text: 'Rating',
dataIndex: 'maxCapacity',
width: 500
}, {
text: 'Avg.',
dataIndex: 'avg',
width: 505,
formatter: 'number("0.00")'
}, {
text: 'Max',
dataIndex: 'max',
width: 80
}, {
text: 'Instant',
dataIndex: 'instant',
width: 80
}, {
text: '%Capacity',
width: 150,


// This is our Widget column
xtype: 'widgetcolumn',
dataIndex: 'capacityUsed',


// This is the widget definition for each cell.
// Its "value" setting is taken from the column's dataIndex
widget: {
xtype: 'progressbarwidget',
textTpl: [
'{percent:number("0")}% capacity'
]
}
}],
renderTo: document.body,
disableSelection: false,
store: {
fields: [{
name: 'id',
type: 'string'
}, {
name: 'maxCapacity',
type: 'int'
}, {
name: 'avg',
type: 'int',
calculate: function(data) {
// Make this depend upon the instant field being set which sets the sampleCount and total.
// Use subscript format to access the other psuedo fields which are set by the instant field's converter
return data.instant && data['total'] / data['sampleCount'];
}
}, {
name: 'max',
type: 'int',
calculate: function(data) {
// This will be seen to depend on the "instant" field.
// Use subscript format to access this field's current value to avoid circular dependency error.
return (data['max'] || 0) < data.instant ? data.instant : data['max'];
}
}, {
name: 'instant',
type: 'int',


// Upon every update of instananeous power throughput,
// update the sample count and total so that the max field can calculate itself
convert: function(value, rec) {
rec.data.sampleCount = (rec.data.sampleCount || 0) + 1;
rec.data.total = (rec.data.total || 0) + value;
return value;
},
depends: []
}, {
name: 'capacityUsed',
calculate: function(data) {
return data.instant / data.maxCapacity;
}
}],
data: [{
id: 'Substation A',
maxCapacity: 1000,
avg: 770,
max: 950,
instant: 685
}, {
id: 'Substation B',
maxCapacity: 1000,
avg: 819,
max: 992,
instant: 749
}, {
id: 'Substation C',
maxCapacity: 1000,
avg: 588,
max: 936,
instant: 833
}, {
id: 'Substation D',
maxCapacity: 1000,
avg: 639,
max: 917,
instant: 825
}]
}
});


// Fake data updating...
// Change one record per second to a random power value
Ext.interval(function() {
var recIdx = Ext.Number.randomInt(0, 3),
newPowerReading = Ext.Number.randomInt(500, 1000);


grid.store.getAt(recIdx).set('instant', newPowerReading);
}, 10000);





Column header alignment completly broken when changing column order under hori-scroll

config property setting in GridPanel constructor

What is the difference between these two code snippet or which one is wrong/Invalid. Kindly note that all other namespace things are correct as far as you concern, It would be very helpful if someone make a working fiddle for the same



1) using Ext.apply in constructor



Code:



var BookGrid = Ext.extend(Ext.grid.GridPanel, {
constructor: function(config) {
var config = {} || config;
var ds = new Ext.data.SimpleStore({
fields: [
{name: 'company'},
{name: 'price', type: 'float'},
]
});
var columnModel = new Ext.grid.ColumnModel({
defaults:{
sortable:true
},
columns:[
{
header: 'Name',
dataIndex: 'company'
}, {
header: 'Price',
dataIndex: 'price'
}
]
});
var cview = new Ext.grid.GridView({
autoFill: true,
forceFit: true,
emptyText: 'no book'
});


Ext.apply(config, {
allowNoSelection: true,
forceFit: true,
title: 'Please Select ...',
layout: 'fit',
reader: reader,
width: 300,
height: 200,
store: ds,
cm: columnModel,
sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
view: cview,
});
BookGrid.superclass.constructor.call(this, config);
}
});


Ext.extend(BookGrid, Ext.Window,{
show : function()
{
if(!this.rendered)
{
this.render(Ext.getBody());
}
BookGrid.superclass.show.call(this);
}
});

I also notice that `Ext.apply(config , {..})` and `Ext.apply({...},config)` has two different meanings. which one is correct

2) adding property in config using .



Code:



var BookGrid = Ext.extend(Ext.grid.GridPanel, {
constructor: function(config) {
var config = {} || config;
config.title = "Please Select";
config.layout='fit';
config.autoScroll=true;
config.split=true;
config.frame=true;
var ds = new Ext.data.SimpleStore({
fields: [
{name: 'company'},
{name: 'price', type: 'float'},
]
});
config.store = ds;
config.sm = new Ext.grid.RowSelectionModel({singleSelect:true});


var columnModel = new Ext.grid.ColumnModel({
defaults:{
sortable:true
},
columns:[
{
header: 'Name',
dataIndex: 'company'
}, {
header: 'Price',
dataIndex: 'price'
}
]
});
config.cm=columnModel;
config.view = new Ext.grid.GridView({
autoFill: true,
forceFit: true,
emptyText: 'no address book'
});

BookGrid.superclass.constructor.call(this, config);
},
show : function()
{
if(!this.rendered)
{
this.render(Ext.getBody());
}


BookGrid.superclass.show.call(this);
}

});





config property setting in GridPanel constructor

can't show data inside the list

Size vertically columns in a border layout

I am a beginner at Ext JS, and I try to do a POC to evaluate it.

I made a container with a border layout, and in its center, I added another container with a column layout.


In each column, I put a mono-column grid panel (the rows of each grid are independent of the other grids).


The problem is, unless I put a height in pixels on the grids, they go beyond the center region, spilling on the south region. I have to set the height to an arbitrary size to get a scrollbar on these grids.


So, my question is: is there a way to tell the layout to size the content of the columns to the height of the center region?

Do I have to listen for resizing events and set the heights accordingly, or is there a smarter, more declarative way?


Thanks.






Size vertically columns in a border layout

hidden panel flicker on slidein show

I need to show a panel on a click event. The panel needs to slide into view on show and it needs to be anchored to the button once shown (the one that has the click event).

The panel config is as follows:



Code:



{
xtype: 'container',
autoScroll: true,
hidden: true,
floating: true,
shadow: false,
listeners: {
show: function(panel) {
panel.el.slideIn('r', {
easing: 'easeOut',
duration: 500
})
}
}

The panel is shown in the button's click event handler:


Code:



helpPanel.showBy(me, 'tr-br');

It works fine, except there is a quick / small flicker before the panel is shown. A bit like the panel is shown and then it is hidden before sliding into the view again.

How can I avoid that flicker? Is this the right way to implement a slide-in show?


Thank you






hidden panel flicker on slidein show

"Pinning" portlets to top of the page

Hi there,

I have another problem using the GXT portal layout.


In our application there are three portal columns. The middle one contains very many portlets (which represent activities in a workflow stream). In the left and right columns, various "widgets" can be placed.


When there are more portlets in the middle column, a scrollbar appears at the right side of the page. Scrolling down means that the whole portal is scrolled, not only the middle column. That means that the portlets in the left and right column are not visible any more when scrolling down.


Is there

- either a way to put the scrollbar only to the middle column of the portal

- or a way to "pin" the portlets to the top of the visible part of the page?


Holger






"Pinning" portlets to top of the page

mardi 23 septembre 2014

Destroying a HTMLEDITOR - Ext.form.field.HtmlEditor

[unable to retrieve full-text content]How to fix this error? 1 Open this link - http://ift.tt/1mP0iIY 2 Enter anything in HTMLEDITOR 3 Press F5 and cancel out ...



Destroying a HTMLEDITOR - Ext.form.field.HtmlEditor

How can I read nested JSON objects.

Hi experts,

I created a Store with nested JSON structures (let's call them Parent and Child). So far I can read the Root set, I actually have them displayed on a Grid, but I can't find a way to read the child objects of each parent. I did a console.log(record) -when clicking on one of the row's grid- in order to check -in Chrome- the selected record's child, I see in the log that the data object inside the record's constructor doesn't have its child objects. But in the raw object of the constructor I can see the child array and it's corresponding objects.


I have created two models, and associated them. I'm simplifying the model names and number of fields as follow:


Model 1:



Code:



Ext.define('ParentModel', {
extend: 'Ext.data.Model',
fields: [
'field1',
'field2'
],
hasMany: [{
name : 'child',
model : 'ChildModel',
associationKey : 'child'
}]
});

Model 2:


Code:



Ext.define('ChildModel', {
extend: 'Ext.data.Model',
fields: [
'childField1',
'childField2'
],
belongsTo: [{
name: 'child',
model: 'ParentModel',
associationKey: 'child'
}]
});

Store:

Code:



var data =
{
"parents" :
[{
"field1": "xyz",
"field2": "abc",
"child":
[
{
"childField1": "qwe",
"childField2": "asd"
},
{
"childField1": "rty",
"childField2": "fgh"
}
]
},{
"field1": "poi",
"field2": "lkj",
"child":
[
{
"childField1": "tgb",
"childField2": "cde"
}
]
}
]};
Ext.define( "myStore", {
extend : 'Ext.data.Store',
model : 'ParentModel',
data : data,
proxy : {
type: 'memory',
reader : {
type: 'json',
root: 'parents',
rootProperty: 'parents'
}
}
});

In this example, when selecting the first parent, I can see in that Parent record, the raw object has a Child array with 2 objects. The second Parent has also the Child array with one object. The data object has no Child array.

I can't seem to find a way to make it work. I validated the original JSON and it's ok.


The objective of the application is to have two views each one with two grids, the first view shows the list of "Parent" objects, when clicking on a row, the second view pop's up and show in the second grid the "Child" objects of the selected parent. At first I thought it was a mapping error in the second view, but then I checked the record and saw that there wasn't any child in the data object, only on the raw.


Please any advise is welcome.


Thanks in advance.


JV






How can I read nested JSON objects.

Ext.List in Bottom Position in A NavigationView

Hi,

I want to put a List at the bottom of a NavigationView, but its seems not work.

The structure of my screen is like that :

A container set to vbox layout


A Panel set docked to bottom

My List



At first, the List View is not visible, but after adding "height: 100%", the list appears but at the top of my panel.

How could I resolve it?


Thank in advance






Ext.List in Bottom Position in A NavigationView

[OPEN] Ext.device.Contacts documentation incorrect



  1. You found a bug! We've classified it as



    TOUCH-5587
    .

    We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.







  2. Default Ext.device.Contacts documentation incorrect



    Ext.device.Contacts documentation incorrect





    http://ift.tt/1mMOmr1

    Touch version tested:


    Description:


    The documentation found at http://ift.tt/1mMOmr1 appears to be incorrect.

    The documentation states the getContacts method returns an Array of contact objects. Looking at the source code found at http://ift.tt/1v7qH4C it is very clear that it does NOT return an Array of contact objects. It looks like a config object must be passed in with callback functions. The only return statements are to return false if an adequate config has not been provided.


    The example at the top of Ext.device.Contacts is also incorrect. Specifically it shows using the return results of the getContacts method as the data for a store.


    Possibly the documentation of Ext.device.Contacts was not updated when a fundamental change to the code was made?


















[OPEN] Ext.device.Contacts documentation incorrect

ID property of reference field being removed in store.remove()



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default ID property of reference field being removed in store.remove()



    ID property of reference field being removed in store.remove()





    http://ift.tt/1vdSXBJ

    Select a record in the top grid, click "remove" in the bottom grid, to remove an associated record.


    The CustomId field is being set to null, this should not be happening. Our API requires the ID field to be sent to the server, so we basically need to re apply this field before calling store.sync(), this didnt happen in EXTJS 4.















ID property of reference field being removed in store.remove()