This is a migrated thread and some comments may be shown as answers.

Doing calculations an save on losefocus

2 Answers 17 Views
Input
This is a migrated thread and some comments may be shown as answers.
Neil N
Top achievements
Rank 1
Veteran
Iron
Neil N asked on 28 Sep 2013, 12:06 AM
More of a best practices type question:

Suppose I have 20 numeric textboxes. As a user enters a number in each one and tabs off the textbox I want that number to be saved to a database and a "total" label to be updated.  I'm looking for a fast response time so ideally the front end wouldn't wait for the database update and commit to be acknowledged.  What would be the best way to architect this?

2 Answers, 1 is accepted

Sort by
0
Neil N
Top achievements
Rank 1
Veteran
Iron
answered on 30 Sep 2013, 08:34 AM
Sorry, the functionality described above should fire on OnValueChanged, not OnBlur.  I'd also like the background to change when OnValueChanging is fired and then change back when OnValueChanged is fired.  As this behavior should be standard throughout the web app (consisting of hundreds of RadInputs I'm thinking I need to extend the control. Possible?
0
Konstantin Dikov
Telerik team
answered on 02 Oct 2013, 01:50 PM
Hi Neil,

I have prepared a sample project for you with extended RadTextBox with assigned event handler for the client-side "OnValueChanged" event. You could add an RadAjaxPanel in the page and on the "OnValueChange" event to fire AJAX request and handle it on the server (get the text boxes values and save them). 

Additionally, please note that "OnValueChanged" is firing right after the "OnValueChanging" and I am not sure if it will be appropriate for changing the background color. Instead, I have set the "cssClass" property and to the CSS class I have set the "background" of the input element when on focus. 

Hope that helps.

 

Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Input
Asked by
Neil N
Top achievements
Rank 1
Veteran
Iron
Answers by
Neil N
Top achievements
Rank 1
Veteran
Iron
Konstantin Dikov
Telerik team
Share this question
or