Validate unique cell value in extjs 4 - extjs

I have a grid with a textfield column. I want to make sure user enters unique data into the cell. But if I use validator event, it validates as soon as the cell gets clicked.
I want to validate it after the cell has finished editing. I have tried validateOnChange, it doesn't fire.

validateOnChange is not an event, rather it's a config option.
Set it to false in your textfield config.

If you wish to validate it after the cell has finished editing,you can use blur event listener:
blur
Other way is using regex and regexText.

Related

how to access the value of input text was nested in ui-grid cell

enter image description here
I made a cell template(ui-grid) which contains a label, a textfield, and a button. I bind a ng-click on the button. But I dont know how to access the value of textfield. Because what I want to implement is when user input value in the field and click save imagebutton and it will call ajax then do some update in web service.
I was wondering that is it possible to access the textfield from row entity, but I could not find the textfield property in the grid-cell.
thank you so much
ui-grid has built in row editor features. Try the link below.
http://brianhann.com/create-a-modal-row-editor-for-ui-grid-in-minutes/

Md-Autocomplete: How to update autocomplete textbox value based on the selection from dropdown?

I am able to achieve that by manually updating the model value which is bind to md-search-text, but that will trigger the autocomplete request again.
Any inputs?

ExtJs property grid - Selected rows editable?

I'm using a property grid with editors set in sourceConfig. I want only some rows to be editable and not all. Returning false in beforeedit disables all. The reason is, I have a button in a grid. When I click the button, the grid turns to a textfield! Any way to do this?
The beforeedit event should provide you with the editor and the editing context. Lets say your callback function looks like this:
function(editor,context) { ... }
Using the context you will get the record which get edited by accessing context.record while the editor can provide you with the editor form from where you have access to all rendered fields within that form. To get the form you have to get the editor first and after that you can fetch the form
var form = editor.getEditor().getForm()
This way you can be sure that the editor has been set up. To get a field within that form simply call
form.findField('fieldname') // fieldname is the dataIndex of the column
You can now do nearly anything based on your conditions.
In addition the record is also loaded into this form an can be accessed by calling form.getRecord()

Telerik autocomplete - checking if user selected a value from the returned set of values

I have a Telerik autocomplete control on my mvc view. I want to show a message to user if the user selects/types a value which isn't from the list of values.
How can this be done?
You can use the OnChange event which will be triggered when you blur from the AutoComplete. Also you have the new value under the e.value field of the event argument object.

ExtJS: focus field

I have a window containing a form (formPanel). Users can show this window clicking on a button in an ExtJS environment. I would like that when the user clicks the button to show the window, a specific field inside the form contained by the window will focus (by this I mean that the cursor should move to that field so that the user can insert data without needing to click on the field itself first).
I tried some solutions, but could not get them work. Any hints?
Here is what I tried, using some examples I found... but it does not work as expected. This function() is called by the ExtJS button in my interface:
function openCardForm(IDUser){
//Reset the value of this field which may be still there from the prev. usage
Ext.getCmp('assignFormCARDNUMBER').reset();
formAssignCard.getForm().load({
url: 'gen/jsonUser.php',
params:{IDUser:IDUser},
waitMsg: 'Loading...'
});
//Try to focus the Card field when rendering the form
Ext.getCmp('assignFormCARDNUMBER').on("render",function(){
Ext.getCmp('assignFormCARDNUMBER').focus(true,10);
});
win.show();
}
try on show instead.
Or Use
defaultButton : yourComponentToFocusOn
A bit confusing but the defaultButton can be any component (not necessary to be an actual button)
You can also try setting the tabindex of the field to zero in its config options...that way you wont even need to add a listener to detect the show event.
ie:
tabIndex:0

Resources