PDA

View Full Version : Open a form after user clicked on a grid row



maxritti
4 Jun 2012, 6:29 AM
Hello all,

i'm searching for a solution to open a form after user clicks on a row in a gridpanel.
Following example looks good. But i don't want to display the form any time. Only when user clicked on a row i want to display the form.

http://dev.sencha.com/deploy/ext-3.3.1/examples/form/form-grid.html

Has any one an idea or another example for me?

For new entries in my grid i use following example and that works fine.

http://docs.sencha.com/ext-js/4-1/#!/example/form/contact-form.html

papaja
4 Jun 2012, 10:42 AM
http://docs.sencha.com/ext-js/4-1/#/guide/application_architecture is a great read for starting with ext 4 and MVC. In this article there is example that you are looking for in part Controlling the grid

maxritti
5 Jun 2012, 10:26 PM
Okay, i will try understanding the concept of MVC applications.

But i get an error in the described AM application.
On my webserver i created the directory structure, index.html, app.js. That works fine.
But in the part "Defining a Controller" i get an error

requires.push is not a function
requires.push(this.getModuleClassName(controllers[i], 'controller'));

in firefox after creating the Users.js in app/controller and inserting


controllers: [
'Users'
],

in my app.js.

I'm a little bit confused!?

papaja
5 Jun 2012, 11:01 PM
Which version of extjs are you using?

maxritti
5 Jun 2012, 11:29 PM
Ext JS 4.0.7

Is this the problem?
I will download 4.1 and try it...

Hm, in source code we can found this one:

ext-4.0

So it should work with 4.0.7 or?

papaja
5 Jun 2012, 11:38 PM
It will definitely work with 4.0.7. Can you share your code, or give me url where it is so I can check what's wrong?

maxritti
6 Jun 2012, 1:16 AM
You've got an email.

papaja
6 Jun 2012, 4:21 AM
I believe you should enable LoadManager like this:

Ext.Loader.setConfig({
enabled:true,
paths:{
'Ext':'lib/ext-4.0/src'
}
});"paths" is not necessary, I've put just for example of another config option.

This code goes to top of your app.js file, before anything else.

maxritti
6 Jun 2012, 5:16 AM
Hi,
thank you for your response.
But it doesn't work.

I added this lines.



Ext.Loader.setConfig({
enabled: true
});


But i get same error.

smintastic
6 Jun 2012, 5:49 AM
...in app.js just add some '[' & ']' before and after 'Ext.container.Viewport' so

Ext.application({
requires: 'Ext.container.Viewport',
name: 'AM',...
becomes

Ext.application({
requires: ['Ext.container.Viewport'],
name: 'AM',...
I think this should be fixed in the guide, especially because it's a beginners guide.

maxritti
6 Jun 2012, 9:00 AM
Thank you very much.
But the documentation is not correct.

here you can't find the brackets.

http://docs.sencha.com/ext-js/4-1/#!/guide/application_architecture-section-2