Kendo UI Sceduler, data bind - kendo-ui

This is a 'getting set up and started' question.
I am trying to set up a KendoUI Scheduler, starting from this demo: http://demos.telerik.com/kendo-ui/scheduler/timeline
No matter what I try, I can't get my internal server-side data to bind to the transport:read:url.
In the end, I took the data that is supplied by the demo url http://demos.telerik.com/kendo-ui/service/meetings and copied it exactly into a function on my server that returns it as a string. The demo doesn't work. Even if I amend the string so that it is json, not jsonp.
So really, my question is, in what format do I supply my data to the scheduler? What should it actually look like?

First of all i have low reputation to make a comment so i am posting this as an answer.
1) if you are using Kendo Scheduler Wrapper (Razor syntax) then you need to pass the data as KendoDataSourceResult.
2) If you are using Kendo scheduler Html / javascript syntax then you need to pass plain json.
That will work
For further clearance can i get a snippet of what you have done and what you actually are trying to achieve?

Related

Typo3 - Create pages and content elements programmatically through Ajax/Front-End

Is there a way to create new pages or content elements programmatically through Ajax from a headless front-end?
I'm just trying to understand Typo3 possibilities and limits.
Yes you can. You will have to use Middlewares (TYPO3 >= 9).
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/RequestHandling/Index.html
Basically you register your Middleware and then you evaluate what you want to do. For example you can set a GET or POST parameter with a key & a value
that look like this: ?object=article and according to what you want to do, you call the class that handles the data. After that, you can return a json response and you are solid.
Hope it helped,
Best regards

Reload TSV File Without Refreshing Page

I've been searching for a day or 2 for an answer to this question, but I haven't found one yet. I've got an external application which is modifying a TSV file (adding data) periodically. I'm using the Basic Line Chart example to display the data and it looks really nice:
Now I want the data to update when the TSV file is updated. I want to be able to set an auto-refresh on the data where it pulls from the tsv file and repopulates the graph without refreshing the entire page.
I tried just wrapping up the current code in a function and calling setInterval on that function, but the data remains the same each time (maybe because it's cached?).
Ideally the solution to this would be a function which can be called to Update whenever I'd like (based on a user event, timer, whatever).
Any ideas, links, or suggestions for alternate ways to accomplish the same goal would be much appreciated!
As a bonus question: I understand D3 may not be the right choice for this sort of Psudo-Real-Time data display. Are there other packages which lend themselves to this sort of thing more? The app generating the data is a C# application (in case that ends up mattering).
Edit: As a supplementary explanation, imagine this example but with the data being read from a file: http://mbostock.github.com/d3/tutorial/bar-2.html
If you are executing an Ajax call to fetch the data from the server and you think caching is a problem, you can try busting the cache by setting the cache parameter in jquery's ajaxSetup to false anywhere in your code:
$.ajaxSetup({cache: false});
From the docs:
If set to false, it will force requested pages not to be cached by the
browser. Note: Setting cache to false will only work correctly with HEAD and
GET requests. It works by appending "_={timestamp}" to the GET parameters. The
parameter is not needed for other types of requests, except in IE8 when a
POST is made to a URL that has already been requested by a GET.

Client side to server side calls

I want to change the list of available values in a dropdown depending on the value selected in another dropdown and depending on values of certain fields in the model. I want to use JQuery to do this. The only hard part is checking the values in the model. I have been informed that I can do this using Ajax. Does anyone have any idea how I will approach doing this?
AJAX is indeed the technology your looking for. It is used to sent an asynchronous request from the client browser to the server.
jQuery has an ajax function that you can use to start such a request. In your controller you can have a regular method tagged with the [HttpPostAttribute] to respond to your AJAX request.
Most of the time you will return a JSON result from your Controller to your view. Think of JSON as something similar to XML but easier to work with from a browser. The browser will receive the JSON and can then parse the results to do something like showing a message or replacing some HTML in the browser.
Here you can find a nice example of how to use it all together.

Getting partial view fragments with Spring MVC

I'm new in Spring MVC, I just started my first project and I'm doing some research to be sure to set it up in a proper way (should work in the long-term!).
I already know that for a part of the project, I will need to manually change small fragments of the page through Ajax. I know it's possible to change part of the page (using Tiles). What I really need, though, is for example to change a single line in a table containing dynamically generated data (i.e. data coming from the database).
Can you suggest anything?
I don't want to use JSF or Spring JS.
Thank you.
You have at least two choices:
render on the server, send the update html snippet to the brower and use JavaScript to replace them
send an AJAX request to the server, but this time return only the data (JSON) and the "render" the table line in the browser (or just update some pices of text)
For the fist choice you need a dedicated jsp file (and tiles configuration) to render only a single line. As fare as I know, there is no technical support.
What you can do, to reduce the amount of duplicated code is to use that single line rendering jsp in like in include in the one that renders the complete table.
Of course instead of using JSP to render the single line you can also use the Java Method that handles the request, and make it returning the html string.

ajax send parameter to jsp but failed

I am trying to send data to my jsp via:"xhr.send(projectCode);"
but apparently the parameter is not received when I am trying to realise it with System.out.print it is a null displayed.
so the story from the begining. my javascript function send the parameter to the jsp whitch construct an xml file and resend to the first one.
this will reconstruct my second dropdownList with the xml code constructed and received.
so the problem that the parameter dosent sent at all.
What should I do.
Just note in case the syntax whatever you have sent is like this:
url="postjob2.jsp?param=" + param;
After param=" keep a space and then the parameter. My issue got resolved as soon as I entered the space.
The simplest all-round solution is to run your application with a HTTP-tracer, such as fiddler for windows or wireshark. In that way you can see if the proper data is being submitted from your client to the server Given the amount of details you provide, I think this is the best starting point

Resources