PDA

View Full Version : Application not running good on firefox



thotavrao
1 Mar 2012, 6:56 AM
The application which rendering and running well not working on firefox.

var App = new Ext.Application({
name: 'NotesApp',
useLoadMask: true,
launch: function () {

Ext.regModel('Note', {
idProperty: 'id',
fields: [
{ name: 'id', type: 'int' },
{ name: 'date', type: 'date', dateFormat: 'c' },
{ name: 'title', type: 'string' },
{ name: 'narrative', type: 'string' }
],
validations: [
{ type: 'presence', field: 'id' },
{ type: 'presence', field: 'title', message: 'Please enter a title for this note.' }
]
});

Ext.regStore('NotesStore', {
model: 'Note',
sorters: [{
property: 'date',
direction: 'DESC'
}],
proxy: {
type: 'localstorage',
id: 'notes-app-store'
}
});

NotesApp.views.noteEditorTopToolbar = new Ext.Toolbar({
title: 'Edit Note',
items: [
{
text: 'Home',
ui: 'back',
handler: function () {
NotesApp.views.viewport.setActiveItem('notesListContainer', { type: 'slide', direction: 'right' });
}
},
{ xtype: 'spacer' },
{
text: 'Save',
ui: 'action',
handler: function () {

var noteEditor = NotesApp.views.noteEditor;

var currentNote = noteEditor.getRecord();
// Update the note with the values in the form fields.
noteEditor.updateRecord(currentNote);

var errors = currentNote.validate();
if (!errors.isValid()) {
currentNote.reject();
Ext.Msg.alert('Wait!', errors.getByField('title')[0].message, Ext.emptyFn);
return;
}

var notesList = NotesApp.views.notesList;
var notesStore = notesList.getStore();

if (notesStore.findRecord('id', currentNote.data.id) === null) {
notesStore.add(currentNote);
} else {
currentNote.setDirty();
}

notesStore.sync();
notesStore.sort([{ property: 'date', direction: 'DESC'}]);

notesList.refresh();

NotesApp.views.viewport.setActiveItem('notesListContainer', { type: 'slide', direction: 'right' });

}
}
]
});

NotesApp.views.noteEditorBottomToolbar = new Ext.Toolbar({
dock: 'bottom',
items: [
{ xtype: 'spacer' },
{
iconCls: 'trash',
iconMask: true,
handler: function () {
// TODO: Delete current note.
}
}
]
});

NotesApp.views.noteEditor = new Ext.form.FormPanel({
id: 'noteEditor',
items: [
{
xtype: 'textfield',
name: 'title',
label: 'Title',
required: true
},
{
xtype: 'textareafield',
name: 'narrative',
label: 'Narrative'
}
],
dockedItems: [
NotesApp.views.noteEditorTopToolbar,
NotesApp.views.noteEditorBottomToolbar
]
});

NotesApp.views.notesList = new Ext.List({
id: 'notesList',
store: 'NotesStore',
itemTpl: '<div class="list-item-title">{title}</div>' +
'<div class="list-item-narrative">{narrative}</div>',
onItemDisclosure: function (record) {
// TODO: Render the selected note in the note editor.
},
listeners: {
'render': function (thisComponent) {
thisComponent.getStore().load();
}
}
});

NotesApp.views.notesListToolbar = new Ext.Toolbar({
id: 'notesListToolbar',
title: 'My Notes',
layout: 'hbox',
items: [
{ xtype: 'spacer' },
{
id: 'newNoteButton',
text: 'New',
ui: 'action',
handler: function () {

var now = new Date();
var noteId = now.getTime();
var note = Ext.ModelMgr.create(
{ id: noteId, date: now, title: '', narrative: '' },
'Note'
);

NotesApp.views.noteEditor.load(note);
NotesApp.views.viewport.setActiveItem('noteEditor', { type: 'slide', direction: 'left' });
}
}
]
});

NotesApp.views.notesListContainer = new Ext.Panel({
id: 'notesListContainer',
layout: 'fit',
html: 'This is the notes list container',
dockedItems: [NotesApp.views.notesListToolbar],
items: [NotesApp.views.notesList]
});

NotesApp.views.viewport = new Ext.Panel({
fullscreen: true,
layout: 'card',
cardAnimation: 'slide',
items: [
NotesApp.views.notesListContainer,
NotesApp.views.noteEditor
]
});
}
});

thotavrao
1 Mar 2012, 6:57 AM
The application running well on chrome but not rendering and running well on firefox

steve1964
1 Mar 2012, 9:56 AM
Seccha Touch work only on webkit browser such as Chrome and Safari, Firefox is not a webkit browser, this is not a bug.

thotavrao
2 Mar 2012, 6:37 PM
Hi Steve,

Thanks for information, but how about firefox for mobile, also, firefox supports good javascript debugging using firebug, if it is supported by sencha touch it is good for developers.

thotavrao
2 Mar 2012, 6:41 PM
If sencha touch supports for desktop, it should work for IE and firefox. As the core library is based on Sencha Extjs which is supported for cross browser, sencha touch also should support all browsers, am I right?

Joz Michael
9 Apr 2012, 3:03 AM
I have the same doubt - thotavrao (http://www.sencha.com/forum/member.php?387665-thotavrao)'s last post...

Can Some one Justify this plz.....

Thanks in advance....

rgporter
27 Jun 2012, 10:24 AM
Sencha Touch does not support desktop browsers outside of Safari and Chrome. It is based on ExtJS, but doesn't contain all the code from ExtJS (if it did, it'd be a memory hog for mobile!)