Where does the Kendo UI Autocomplete cache its data? - autocomplete

I have a project where I have the Kendo UI Autocomplete installed and working nicely. I have turned off server-side filtering and turned on caching with the control. I have verified that the method specified (I'm using it in and MVC 4 environment) in the controller is called only once and that the filtering is happening on the client side.
Before I deploy my application, I need to know for sure that the control caches all of its data on the client, and not in the application pool or anything like that.

The data for the AutoComplete will be read once into a new Kendo DataSource instance, and assigned dataSource property of the AutoComplete widget. The widget then won't need to query the server for data again because the data is retained in an array in that DataSource.
You can verify this by looking at the data that is in the DataSource, if you get a reference to the AutoComplete widget.
var data = $("#autocomplete").data("kendoAutoComplete").dataSource.data();

Related

Angular 4 - Saving form data of highly complex form

We have highly complex form in Angular 4 and we want to be able to save form data as an object to be able to send to our DB and also to external APis in json.
Form has tabbed form wizard format and each tab had lot of form controls and each tab itself is very complex.
So we plan to create a data service where at each step, we plan to put data in an object, and keep updating as we nagivate till the end. If user clicks save drafts at any time in form wizard, current state of form data object will go in DB.
Form next, previous work same way, retrieve or updating form data object.
When saving form or submitting form, we will have post http call to backend.
Is there any better approach to achieve this? or we are following right direction. Any examples will be great.
No better approach. You put your complete model in the service. Than create sub-models inside that model that correspond to your individual tabs. In each component, get the model from the service, and keep updating the appropriate model for the tab you are on.

changes in live classes & existing clients in azure mobile services with dot net backend

we have a live azure mobile service using dot net backend. The apps using it are out & people are using them.
If we add a few more nullable fields to one of the classes in azure service, will the existing client apps keep working, without an update?
Or do all users must require to update the app before continue using the services?
Existing clients will keep working. On the client side, when it receives objects with properties which it doesn't understand the serializer will just ignore those. On the server side, when it receives the data from old clients, any properties which you have added to the class will have its default value (e.g., if you have a new integer property, it will have the value 0, and for string properties the value null). As long as the logic in the service controller can handle those default values, then your application will be fine.
If you are using entity framework.Base on my test, it's OK.You don't have to change your client-side data model.
P.S. If you just change your entity class.It may clear your database.Be careful with that.
If you want Entity Framework to alter your database
automatically whenever you change your model schema, please use data migrations.
For more information refer to the documentation:
http://msdn.microsoft.com/en-us/data/jj591621.aspx

How to update a CellTable dynamically using GWT

Working on a GWT app that uses a CellTable to display data. I was wondering if it was possible to update this CellTable dynamically when data from the database has changed(without a specific button). Maybe each 2 seconds or something like that.
I looked for a while and I'm... :
onRangeChanged(AsyncDataProvider) is fired only when the user modify the table. right?
So, am I obliged to implement a solution which uses WebSocket like Atmosphere or gwtEventService? or is there an other way?
Thanks
Yes you are right, there is nothing in gwt which links the table with the server side out-of-the-box.
Maybe someday RequestFactory could have a comet server push mechanism so as entities are notified when there are server changes.
So the solution right now is to configure an AsyncDataProvider for your table and use some server push library like you point (I use gwt-atmosphere) to fire an event whenever the data is modified so as the data provider could update the table.
This guide should help, GWT has a built in way of doing this through a DataProvider. There is even a specific AsyncDataProvider class.

Knockout viewmodel concept

I was not able to find an answer for the following... please gimme an advice.
I have a form that is built dinamically basing on metadata being obtained from server via ajax request. It gets about 20 values for display data and also about 10 fields for user input. Thus, the presentation view model and post view model are different. Filled fields are posted back via ajax as well.
How do i apply Knockout view models concept correctly?
1. I make a single viewmodel for displaying and posting data. In this case AJAX call will post back a lot of redundant data to server. Option: i can send a new object that will contain only input fields, but it doesnt look OK in KO concept.
2. I make a single viewmodel containing only fields for user input. Read-only fields to display stay out of KO view model and populated using common jQuery methods (so we're out of pure KO style again)
3. Or?
I appreciate your ideas.
Knockout provides the ability to apply MVVM pattern to a client-side (HTML5/Javascript) app. Your JavaScript view model should provide all the data and properties necessary to operate the view or views that it is responsible for, both for user input fields and display-only fields.
Once you post something back to the server, you're leaving the MVVM world and reaching into another layer to perform some operation. As a result, I think it's best to formulate JSON that contains only the data that the server needs to complete the request. On the server side, you may have a C# model with validation attributes or whatever, but, again - you're not trying to adhere to MVVM pattern there.
Hopefully this helps. I'm happy to elaborate if needed.

How do I implement a "registration confirmation" in ASP.NET MVC?

I'm an absolute beginner with ASP.NET MVC and I'm trying to build a pretty simple application, but I'm having a hard time getting out of the webforms thinking.
I need to register users so they can download my application. I need to capture their information in three screens. Rather than write the database from each view, I want to aggregate all of the data they enter and let them confirm it before they submit their information.
I've been playing with various models and such but if I make one big model, the scaffolding wants to put all the fields on one view.
Can anyone point me in the right direction?
Sounds like you need a Wizard. Here's a few samples:
http://highoncoding.com/Articles/647_Creating_Wizard_Using_ASP_NET_MVC_Part_1.aspx & a youtube video
http://shouldersofgiants.co.uk/Blog/post/2009/09/18/A-RESTful-Wizard-Using-ASPNet-MVC-2e280a6-using-Data-Annotations.aspx
ASP.NET MVC is stateless, which means it doesn't save state between views like Webforms does.
You should save the information from each view into the database, and then set a flag in the user's database record at the end, indicating that the user confirmed their information.
If you need three separate views, you can always copy parts of the code created by the scaffolding to each of the three new views, using only those fields you want the user to see in each view.
If you need validation in each view, use a ViewModel object for each view that pertains only to those fields in the associated view.