hunt
hunt

Reputation: 321

How to completely remove the value store in the text box?

function NewRecord() {
   var id = Ext.getCmp('input_id').clear();
   var code = Ext.getCmp('input_code').clear();
   var description = Ext.getCmp('input_description').clear();
}

I need to remove the value from text box, it works but code behind still gets the id. The code above i do it in js.

Upvotes: 0

Views: 154

Answers (3)

Chetan Sanghani
Chetan Sanghani

Reputation: 2111

function NewRecord() {
   var id = Ext.getCmp('input_id').setValue("");
   var code = Ext.getCmp('input_code').setValue("");
   var description = Ext.getCmp('input_description').setValue("");
}

you can clear the text value by setValue(""). please try this.

Upvotes: 0

Thanh Nguyen
Thanh Nguyen

Reputation: 712

Instead of using Id, you can set a value for the reference property. In view controller, call: this.lookupReference("refNameToTextBox") to get reference to the textbox;

Upvotes: 0

S M
S M

Reputation: 3233

Try this.

function NewRecord() {
       var id = Ext.getCmp('input_id').remove();
       var code = Ext.getCmp('input_code').remove()
       var description = Ext.getCmp('input_description').remove();
    }

Upvotes: 1

Related Questions