PDA

View Full Version : Forms+ASP.Net, TextField, ComboBox : Problems



ferr
19 Oct 2007, 1:54 PM
1) I tried creating an Ext.form.Form with a few basic controls within an aspx file, but apparently it is invalid to nest forms. The solution I found uses a dummy form (http://extjs.com/forum/showthread.php?t=4446).. has there been any other progress in this area or is this the simplest way of solving the problem? And does it solve it 100%? I ask that because the form isn't showing up as it does in the API's Dynamic Forms tutorial.. the background is missing.

2) The reason I got into messing with the Form control was because I wanted to use the Ext.form.TextField control, which I cannot get to work properly without it being inside of an Ext.form.Form. Is that required for a TextField or am I screwing something up? I get no error, it just doesn't show up at all.


var tf = new Ext.form.TextField('text-field1',
{
fieldLabel: 'Test Here',
name: 'testingtext'
});

...
<div id="text-field1" style="position:absolute; top:890px; width=20px; height:50px;"></div>


3) I'm loading an Ext.form.ComboBox with a json-format httpproxy data store which has parameters on load specifying the start and limit for paging purposes.. the problem is when I initially load my site, the ComboBox is empty (yet my paging grid which uses the same datastore object is populated), and if I go to the next page on my paging grid which uses the same data store, suddenly the combo box is loaded (with the currently viewed page's datain the combo box).



// create the Data Store
var ds = new Ext.data.Store({
// load using script tags for cross domain, if the data in on the same domain as
// this page, an HttpProxy would be better
proxy: new Ext.data.HttpProxy({
url: 'test.aspx'
}),

// create reader that reads the Topic records
reader: new Ext.data.JsonReader({
root: 'documents',
totalProperty: 'totalCount',
id: 'doc_id'
}, [
{name: 'title', mapping: 'doc_title'},
{name: 'library', mapping: 'library'},
{name: 'totalPosts', mapping: 'topic_replies', type: 'int'},
{name: 'lastPost', mapping: 'post_time', type: 'date'},
{name: 'excerpt', mapping: 'post_text'}
]),

// turn on remote sorting
remoteSort: true
});
...
ds.load({params:{start:0, limit:45}});

...

new Ext.form.ComboBox({
store: ds,
displayField: 'library',
fieldLabel: 'Library',
typeAhead: true,
name: 'PM',
triggerAction: 'all',
emptyText:'Select a library...',
selectOnFocus:true,
width: 225
})

The ComboBox is instantiated within a Form column.

Bonus) When sorting my records which are populated in a paging grid, only the records on the current page become sorted. Is there a simple way to sort the entire grid when toggling the headers.. or will I have to write something to the extent of 'onToggled: query the records again with a different order by'