w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Can you use Kendo UI's dataSource to get data straight from a database or C# dataSource?
Yes. It can bind to pretty much any source of json, so you have a lot of options. In WebForms, a good one is WebMethods. You could add a WebMethod to your form and then bind the DataSource to it. Or you could also create a web service, or build an aspx that renders json or xml instead of html (make sure you set the content-type!), or even call a static file that contains json. I would start with reading this overview of the DataSource: http://docs.kendoui.com/getting-started/framework/datasource/overview

Categories : C#

Bind kendo.data.datasource json data to kendo listview
You have placed schema inside transport definition while it is member of DataSource. Try: category = new kendo.data.DataSource({ serverFiltering: true, transport : { read: { type : "POST", url : "http://localhost:60143/Mobile/Menu/MenuData.asmx/getCategory", contentType: "application/json; charset=utf-8", dataType : "json", error : function (xhr, ajaxOptions, thrownError) { alert("error " + xhr.responseText); } } }, schema : { data: "d" }, type : "json", parameterMap : function (options) { return JSON.stringify(options); } });

Categories : Json

Kendo ui datasource refresh?
It seems to be that only the data is read with dataSource, you need to refresh the grid also like this: $("#Product").data("kendoGrid").dataSource.read(); $("#Product").data("kendoGrid").refresh();

Categories : Kendo Ui

Kendo dataSource Parameter Map
You can find quite clear explanation in here parameterMap You should use parametrMap to define custom set of parameters or perform additional operations during the call to remote service. Basically here you saying, if I am reading, updating or deleting (this is the operation variable of value "read" in your snippet) I want to add following parameter(s) to the methods I defined in "transport". In your case you didn't defined options.models so it seems, which means your datasource doesn't have any variable/collection models. Well it doesn't have to. To me it looks like the read method you trying to call doesn't really need any parameters so you might just return empty string from the paramMap or not to have this configuration section at all. NOTE: the way you defined the datasource is bit

Categories : Jquery

kendo grid with more than one datasource
Create a ViewModel wich contains your three RadioButtons: public class MyViewModel { public int Id {get;set;} public bool Radio1 {get;set;} public bool Radio2 {get;set;} public bool Radio3 {get;set;} } Then fill the ViewModel in your Controller (Customer) and specified Action (GetCustomer) public class CustomerController : Controller { ....... public ActionResult GetCustomer([DataSourceRequest] DataSourceRequest gridRequest) { IList<MyViewModel> myViewModels = new List<MyViewModel>(); //fill ViewModels here from stored Procedures return Json(myViewModels.ToDataSourceResult(gridRequest)); } ........ } Then change your view Code as follows: @(Html.Kendo().Grid<MyViewModel>() .Name("CustomerSearch")

Categories : Asp Net Mvc

Update Kendo UI Datasource
var dataSource = new kendo.data.DataSource({ //define datasource parameters as per your requirement }); var grid = jQuery("#grid").kendoGrid({ dataSource: dataSource, }); jQuery('#changeevent').change(function() { dataSource.read({ parametername:jQuery("#valueoffeild").val() }); var grid = jQuery("#grid").data("kendoGrid") grid.refresh(); }); Above code pass extra parameter to your url.

Categories : Jquery

Saving a Kendo datasource using jStorage
Define your DataSource as: var ds = new kendo.data.DataSource({ transport: { read : function (op) { var data = $.jStorage.get('favoritter'); if (!data) { data = [ {id: 5, name: "LINK ONE", url: "http://www.linkone.com" } ]; } op.success(data); }, update : function (op) { $.jStorage.set("favoritter", ds.data()); op.success(op.data); }, destroy: function (op) { console.log("destroy", ds.data()); $.jStorage.set("favoritter", ds.data()); op.success(op.data); }, create : function (op) { $.jStorage.set("favoritter", ds.data()); op.success(op.data);

Categories : Kendo Ui

kendo ui how to filter dataSource requestStart
The changes I did to solve the progress endlessly problem where 2. Removing requestEnd function from the dataSource Adding dataBound function to the Grid Data Source Code dataSource = new kendo.data.DataSource({ transport: { read: { url: url_Obtener_Periodo, type: "POST" }, parameterMap: function (options, operation) { if (operation == "read" && options) { return { "periodo.Year": $("#periodo-anio").val(), "periodo.Month": $("#periodo-mes").val(), "Filtro": $("#Filtro").val() }; } } }, schema:{ model: { id: "Codigo_De_Pedido", fields: { Codigo_De_Pedido: { type: "number" }, Fecha_Y_Hora_De_Creacion: { type: "date" }, UserName: { type: "string" },

Categories : Kendo Ui

Kendo Treeview with remote datasource issue
Define select handler as: select : function (e) { var data = this.dataItem(e.node); console.log(data.id); } Since this in the context of the select handler is the tree. Example here http://jsfiddle.net/OnaBai/MLdeH/ NOTE: Try just removing name: "Admin Menu", it will also work!!!

Categories : Jquery

How to set data item in datasource for listview kendo ui
Can you use something like this? var firstItem = $('#listView.product1 h3').data().kendoListView.dataSource.data()[0]; Or with jquery, you just use $('#listView.product1 h3').text("Some updated text"); or $('#listView div.product1 h3').text("Some updated text"); if you want it to search in divs only.

Categories : Jquery

Kendo UI Sparkline - Datasource/Series/Categories
Never fails, you look at and Google something for hours and then moments after posting the question you see your own stupid mistake... @(Html.Kendo().Sparkline(Model.jphList) .Name("jph-graph") .Theme("black") .Type(SparklineType.Column) .Tooltip(tooltip => tooltip.Format("{0:n2}")) .DataSource(ds => Model.jphList.Select(g => new { date = g.production_date, value = g.value }).ToList()) .Series(series => series.Column("value")) )

Categories : Asp Net

Refresh datasource dynamically in kendo mvvm
Every time you have a country selected, you can filter the states available, so you don't have to care about it in the next popup. See examples here http://docs.kendoui.com/api/framework/datasource#methods-filter

Categories : Database

ajax with kendo datasource in jsfiddle using echo api
A couple of issues: You should use the new operator to instantiate a data source: var ds = new kendo.data.DataSource({ /* options */ }); For some reason /echo/json/ didn't like the delay option. Removing it fixes it. The dataSource option of the grid is never set. Here is the updated fiddle: http://jsfiddle.net/3GqVR/9/

Categories : Ajax

Kendo UI DataSource not triggering transport.destroy
On your datasource, you have the batch flag set to true, this means the datasource will make the call only after you tell it to, e.g calling sync(). http://docs.kendoui.com/api/framework/datasource#configuration-batch As well as Make sure you have defined Id in the model, as OnaBai explained here Why does the KendoUI Grid Transport Create event gets raised multiple times, and even when the action is Update? , your id is outside the model, should be in : model: { id: "ProductID", fields: { ProductID: { editable: false, nullable: true }, } }

Categories : Kendo Ui

Kendo UI DataSource with Spring MVC model attribute
I figured out the answer, instead of using the bind method, I declared change="onChange" in kendo:grid tag, and I implemented the onChange method in the same jsp file.

Categories : Javascript

Kendo ui grid datasource for nested json
I got it done already, using schema: parse on datasource found it at here How can I use nested Json to populate Kendo UI grid?

Categories : Json

new datasource doesnt refresh the listView of kendo ui
I haven't dealt with KendoUI, but I have worked with several other Telerik controls. They've all required that the datasource be set to null, then set to the new value. If I skipped the setting to null, it wouldn't update.

Categories : Misc

Kendo MVC Grid Within a Window DataSource Read
Here's what worked for me: 1) View (~/Views/Home/Index.cshtml) @(Html.Kendo().Window() .Name("myWindow") .Title("Title") .Actions(actions => actions.Pin().Minimize().Maximize().Close()) //.Content(Html.Partial("gridCat").ToHtmlString()) .LoadContentFrom("Load_gridCat", "Home") ) 2) Partial View (~/Views/Shared/gridCat.cshtml) @(Html.Kendo().Grid<TelerikMvcApp1.Models.Category>() .Name("CategoriesGrid") .Columns(columns => { columns.Bound(c => c.CategoryID).Title("Category").Width("10%"); columns.Bound(c => c.CategoryName); columns.Bound(c => c.Description); }) .Filterable() .Pageable() .Sortable() .Scrollable() .DataSource(dataSource => dataSource .Ajax() .Model(model => model.Id(p => p.CategoryID))

Categories : Asp Net Mvc

Mapping XML child elements to a Kendo UI DataSource
After some trial and error I came up with the following solution: schema: { type: "xml", data: "/topics/topic", model: { fields: { id: "@id", title: "@title", header: "header/text()", smallicon: "smallicon/text()", // > ANWER: THIS IS HOW children: "items" }, hasChildren: "items" } } Now there are two changes in this snippet in comparison to my original question: The children: "items" node is added to the schema The hasChildren: "items" property With this in place, everything worked out well and the hierarchical structure was mapped just nicely. As a bonus, I'm now able to do the following: // fetch the one, single topic from the datasource topic = da

Categories : Kendo Ui

Kendo DataSource How to define a Model.Id when using DataTable
You can bind to a DataTable. In fact, we do a lot of dynamic grids and DataTable is our only recourse. Binding is a little different, though. A snippet for one of ours is like this: @model System.Data.DataTable @(Html.Kendo().Grid(Model) .Name("SomeGrid") .Columns(columns=> { foreach(System.Data.DataColumn column in Model.Columns) { columns.Bound(column.ColumnName).Title(column.Caption).Width(200); } } ) .Selectable(selectable=>selectable .Type(GridSelectionType.Row) ) .DataSource(dataSource => dataSource .Ajax() .Model(model => { foreach(System.Data.DataColumn column in Model.Columns) { model.Field(col

Categories : Kendo Ui

Kendo UI DropDownList dataSource from external url not working (SOLVED)
The difference is in between the responses, your one is wrappeped in callback keyword : callback([{"CustomerID":"ALFKI","ContactName":"Maria Anders","CompanyName":"Alfreds Futterkiste"},{"CustomerID":"ANATR","ContactName":"Ana Trujillo","CompanyName":"Ana Trujillo Emparedados y helados"}]); Kendo one is not. Solution is to set jsonpCallback parametr (fiddle : http://jsfiddle.net/vojtiik/2JTsT/): transport: { read: { dataType: "jsonp", jsonpCallback: "callback", url: "http://www1.com.br/Customers", } }

Categories : Javascript

Kendo DataSource appends Schema Id on datasoure sync
As agendaBatch is obviously an array, I assume that kendo.stringify is not serializing it properly. You could go with JSON.stringify. Note that this is not implemented by older browsers. If you need to support them, you could include the script by Douglas Crockford: https://github.com/douglascrockford/JSON-js/blob/master/json2.js EDIT Now that you changed your question - I am not really familiar with kendo ui, so this really is just a wild guess in an attempt to help you with your updated problem. It looks like you have access to the data in the beforeSend function. You could try to manipulate it for your needs, like this maybe: beforeSend: function (xhr, s) { var arrayData = []; for (var id in s.data) { arrayData.push(s.data[id]); } s.data = arrayData; }

Categories : Javascript

Loading Image in a column of datasource in Kendo UI Grid
Try defining the field as well: field: "Image", title:"Image", template: '<img src="~/Content/Themes/Default/images/Door.jpg"' If that works, then add back in the sizing parameters.

Categories : Jquery

Kendo UI Grid JSON DataSource not loading data
Code looks good. I wonder if you change data source creation as below . Change type from POST to GET and see if it works, var remoteDataSource = new kendo.data.DataSource( { transport: { read: { type: "GET", dataType: "json", url: "/home/getopportunities/" } }, pageSize: 4 })

Categories : Json

How to remove all data item in kendo ui listview datasource
When you add the data to your grid datasource, you can create a new datasource and set the listview datasource like the following: /// ... do your add code to grid dataSource var listView = $("#listView").data("kendoListView"); var newDataSource = new kendo.data.DataSource(/* your data source options */); listView.setDataSource(newDataSource); See the official documentation for more information here: http://docs.kendoui.com/api/web/listview#methods-setDataSource

Categories : Kendo Ui

bind kendo.data.DataSource to combo using MVVM
I didn't get the answer , so i found an alternate working ice of code. just have a look and if it helps then please vote. created model for ddl in js file ddl = kendo.data.Model.define({ fields: { CountryId: { type: "int" }, ConfigurationID: { type: "int" } } }); added var ddl to MVVM js file vmSupplier = kendo.observable({ CountryId: new ddl({ CountryId: 0 }), ConfigurationID: new ddl({ ConfigurationID: 0 }),}); added code in controller using (CountriesManager objCountriesManager = new CountriesManager()) { ViewBag.Countries = new SelectList( objCountriesManager.GetCountries().Select(p => new { p.CountryID, p.CountryDesc }) , "CountryID", "CountryDesc"); ; } added code in cshtml

Categories : Asp Net Mvc

Kendo UI Grid: Configuration of the DataSource with Context Model
It looks like your code is similar to the example for the Kendo Grid at http://demos.kendoui.com/web/grid/index.html I would start by setting up a ViewModel class for Company that would hold all of your columns for the grid similar to how they have a ProductViewModel in their example. For instance, you would have the following in your ViewModel: Name, DateCreated, Quarter, Code, Enabled If you navigate to ASP.NET MVC > IndexController.cs you'll see where they've defined their method: public ActionResult Products_Read([DataSourceRequest] DataSourceRequest request) From there you'll see that they wrapped their LINQ results into their ViewModels and returned them in JSON format. You're on the right track for setting up the DataSource for your grid. As far as the Controller goes, y

Categories : Linq

Why is my kendo ui grid not reading the assigned datasource-action?
I saw a couple of things: Your grid is initially server bound. It won't make a request until you page/sort/filter etc. This is easily fixable: @(Html.Kendo().Grid(Model.UnitDetails) should be @(Html.Kendo().Grid<UnitDetail>() You are including jQuery twice. This is redundant. Include only one.

Categories : Asp Net Mvc

Get record count in Kendo Grid after dataSource.read
According to the API Reference here the dataSource has a total() function. So you should be able to do the following, in theory: function refreshData(){ var grid = $("#SearchWindowGrid").data("kendoGrid"); grid.dataSource.read(); var count = grid.dataSource.total(); $("#countElement").val(count); }

Categories : Jquery

Kendo DataSource reads my remote database but won't save things to it
So thanks to giltnerj0 and Brett's comments, I was able to google the right words, and discovered that all I needed to do was change create's dataType:jsonp to json. I'm getting some POST errors now, but it's POSTing finally and saving things to my database. create: { url: 'website/petData', dataType: "json" }

Categories : Kendo Ui

Kendo, How do you bind MVVM text: fields to a remote DataSource?
DataSource expects to operate on a collection of records. I'm sure you can get around that with parse or schema but for this example I changed the mock ajax call to return an array. $.mockjax({ url: "js/data/person.json", contentType: "application/json", responseText: [{ firstName: 'James', lastName: 'Taylor' }] }); The first problem is that you setup the datasource but never populate the data. I added a call to .read() personSource.read(); As I changed the responseText to an array, I updated your bindings similar to this: data-bind="text: dataSource.view()[0].firstName" Lastly, here's an updated fiddle

Categories : Javascript

Kendo UI ASP.Net MVC ForeignKey column DataSource in InCell Edit mode
I figure this out on how to filter Product drop-down using EditorTemplate for the foreign key column. Here is my column definition for the Product. c.ForeignKey(x => x.ProductID, (List<Product>)ViewData["products"], "ID", "ProdName").EditorTemplateName("ProductIDEditor"); Here is the editor template for Product, ProductIDEditor.cshtml @using Kendo.Mvc.UI @(Html.Kendo().DropDownListFor(m => m) .AutoBind(false) .OptionLabel("Select a value...") .DataTextField("ProdName") .DataValueField("ID") .DataSource(dataSource => { dataSource.Read(read => read.Action("FilterProducts", "Home").Data("filterProducts")) .Serv

Categories : Kendo Ui

Kendo UI: Update transport doesn't trigger after calling datasource sync
Your code is not complete (you are not showing what is result or how you trigger saveChanges but from what I see the problem is that you are not updating the content of the DataSource (meetingDataSource). In your code that you copy the fields from result into and ObservableObject but you never update the content of the DataSource. When you do this.set, in that context this is not the DataSource so when you call sync you are doing nothing. Try doing: meetingDatasource.data()[0].set(`Title`, this.Title); meetingDatasource.sync(); This should do the trick!

Categories : Ajax

GridView with both declarative (Html side) datasource and code-behind datasource
It is possible only under one condition.That you set the DataSourceID to nothing of your gridview before re-assigning its datasource to a datatable.Otherwise visual Studio will scream loudly at you in these lines 'Both DataSource and DataSourceID are defined on 'yourGrid'. Remove one definition.' yourgrid.DataSourceID=null; yourGrid.DataSource=yourDataTable;

Categories : Asp Net

How to register wso2 datasource defined in custom-datasource.xml in jndi
The useDataSourceFactory should be set as an attribute of jndiConfig element. So your datasource configuration should shange as follows. <datasource> <name>IPL_DS_IDB</name> <description>My custom datasource</description> <jndiConfig useDataSourceFactory="true"> <name>IPL_DS_DB</name> <environment> <property name="java.naming.factory.initial">com.sun.jndi.rmi.registry.RegistryContextFactory</property> <property name="java.naming.provider.url">rmi://localhost:10002</property> </environment> </jndiConfig> <definition type="RDBMS"> <configuration> <url&g

Categories : Wso2

Migrating Datetime to DateTimeOffset
There are no such tools in SQL Server itself, however there 3rd party tools, that wrap up management tasks of a DB and generate change scripts for you. In absence of a third party tool, you can write a script that will generate change scripts for you. Here is a sample script, that finds all columns of datatime type and generate script to change it to DateTimeOffset data type. select OBJECT_NAME (a.object_id) as Table_Name ,a.name as Colimn_Name ,b.name as Old_Datatype ,'ALTER TABLE ' + OBJECT_NAME (a.object_id) + ' ALTER COLUMN ' + a.name + ' DATETIMEOFFSET ' + CASE a.is_nullable when 1 then ' NULL ' else ' NOT NULL ' END from sys.columns a join sys.types b on a.user_type_id = b.user_type_id join sys.tables c on a.object_id = c.object_id where b.name = 'datetime' and c.type

Categories : SQL

DateTimeOffset resolution in c# and SQL Server
I'll say that the problem is yours... A little code to show: namespace Test { using System; using System.Data; using System.Data.SqlClient; using System.Globalization; /// <summary> /// /// </summary> public class Program { /// <summary> /// /// </summary> public static void Main() { // Change the connection string to specify your server. // Probably you won't need an initial catalog because this // program uses a temp table string connStr = "Integrated Security=True"; // The temp table is called #Temp . It will cease to exist at the end // of the program automatically // Two columns, DateTimeOffset an

Categories : C#

How to cast datetime to datetimeoffset?
To convert from a local time to a datetimeoffset with the current time offset seems to take some trickery. There's probably a simpler way, but this seems to do it; SELECT ChangeDate, CONVERT(DATETIMEOFFSET, CONVERT(VARCHAR, ChangeDate, 120) + RIGHT(CONVERT(VARCHAR, SYSDATETIMEOFFSET(), 120), 6), 120) FROM AuditLog; It's probably worth creating a function; CREATE FUNCTION LOCALIFY(@dt DATETIME) RETURNS DATETIMEOFFSET AS BEGIN RETURN CONVERT(DATETIMEOFFSET, CONVERT(VARCHAR, @dt, 120) + RIGHT(CONVERT(VARCHAR, SYSDATETIMEOFFSET(), 120), 6), 120) END; ...and then just... SELECT ChangeDate, dbo.LOCALIFY(ChangeDate) FROM AuditLog;

Categories : Sql Server

.NET 3.5 JavaScriptSerializer and DateTimeOffset serialization
The bigger problem is when you serialize Date value and Deserialize it back, you lost DateTimeOffset and the Deserialized value is in UTC time. So let's start from begining, what kind of serializer/deserializer you user? .Net / Json.Net / LightJson / ...

Categories : Dotnet

Not Sure How To Convert to DateTimeOffset Correctly
This should be fairly simple to do with SQLCLR. Assuming the time zone is always EST, something like this should work: using System; using Microsoft.SqlServer.Server; namespace SqlUtilities { public static class Dates { private static readonly TimeZoneInfo EST = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); [SqlFunction( Name = "ToDateTimeOffset", DataAccess = DataAccessKind.None, IsDeterministic = true, IsPrecise = true )] public static DateTimeOffset? ToDateTimeOffset(DateTime? value) { if (value == null) return null; var source = value.Value; var offset = EST.GetUtcOffset(source); return new DateTimeOffset(source, offset); } } }

Categories : Sql Server



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.