Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everybody,
I am new to ExtJS. Please suggets me for below query.

I have a grid and in the grid I have one textbox on the toolbar of grid. I want to get the textfield value and sent that to servlet file.

How I can get the textbox field value in extjs?

Thanks in Advance.
Posted
Comments
Member 11443587 11-Feb-15 2:40am    
example of your code? and what you tried to do before ask question here?
Member 11443587 11-Feb-15 3:03am    
Um... what have you tried so far ?

1 solution

C#
try this

Ext.create('Ext.window.Window', {
  bodyPadding: '5 5 5 5',
  items: [
    {
      xtype: 'textfield',
      name: 'firstName',
      emptyText: 'First Name',
      width: 250
    },
    {
      xtype: 'button',
      text: 'click me',
      handler: function() {
        //WAY1
        var value1 = Ext.ComponentQuery.query('textfield[name=firstName]')[0].getValue();
        console.log(value1);

        //WAY2
        var value2 = this.up('window').down('textfield[name=firstName]').getValue();
        console.log(value2);
      }
    }
  ]
}).show();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900