Hunt
Hunt

Reputation: 8425

render form over grid

I have created Form and Grid Panel in Extjs now i want to display a form over a grid when i click on a "Add Record" button

example

enter image description here

Upvotes: 1

Views: 428

Answers (1)

Christopher WJ Rueber
Christopher WJ Rueber

Reputation: 2161

What you're looking for is a modal Window. A la..

var window = new Ext.Window({
  modal: true,
  items: [ yourFormPanel ]
)};

You can put the standard form panel inside of the items in the Window itself (thus the 'yourFormPanel' variable), along with any other configuration options. Once you have everything in the window, you just use the show() method to put the Window on the screen. Which probably would be done from the button handler in this case. Should look something like this.

var button = new Ext.Button({
  text: 'Add Record',
  handler: function() { window.show(); }
});

That's it!

Upvotes: 2

Related Questions