or
Below is a data source which connects to an external REST service. All is well, except when I want to do a query and not return the entire set of data. I need to URL encode with messageTo = xxx but I am unsure of the correct syntax in a Kendo datasource or if this is supported at all..
Are you able to assist? Source code below. The code in BOLD is not working
Best Regards,
Damien.
var dataSource = new kendo.data.DataSource({
serverPaging: true,
pageSize: 10,
transport: {
read: {
type: 'GET',
headers: {'X-Parse-Application-Id':'MY_AUTH_KEY','X-Parse-REST-API-Key':'MY_SECOND_KEY'},
data: "{ messageTo: 'USER_ID_HERE'}",
dataType: "json" // JSONP (JSON with padding) is required for cross-domain AJAX
},
},
schema: { // describe the result format
data: "results" // the data which the data source will be bound to is in the "results" field
}
});
I was wondering if you might be able to get rid of the Kendo loading image on the initial page load?
My code is below.
HomeController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace KendoMobileAppV2.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
return View();
}
public ActionResult About()
{
ViewBag.Message = "Your app description page.";
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
}
}
<!DOCTYPE html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"utf-8"
/>
<
title
>@ViewBag.Title</
title
>
<
meta
name
=
"viewport"
content
=
"width=device-width"
/>
<
link
href
=
"~/favicon.ico"
rel
=
"shortcut icon"
type
=
"image/x-icon"
/>
@Styles.Render("~/Content/mobileCss", "~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Styles.Render("~/Content/kendo")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/kendo")
@Scripts.Render("~/bundles/jquerymobile")
</
head
>
<
body
>
<
div
data-role
=
"page"
data-theme
=
"b"
>
<
div
data-role
=
"header"
>
<
h1
>@ViewBag.Title</
h1
>
</
div
>
<
div
data-role
=
"content"
>
@RenderBody()
</
div
>
</
div
>
@RenderSection("scripts", required: false)
</
body
>
</
html
>
@{
ViewBag.Title = "Home Page";
}
<
h2
>@ViewBag.Message</
h2
>
@(Html.Kendo().DatePicker().Name("Birthday"))
<
p
>
To learn more about ASP.NET MVC visit <
a
href
=
"http://asp.net/mvc"
title
=
"ASP.NET MVC Website"
>http://asp.net/mvc<;/
a
>.
</
p
>
<
ul
data-role
=
"listview"
data-inset
=
"true"
>
<
li
data-role
=
"list-divider"
>Navigation</
li
>
<
li
>@Html.ActionLink("About", "About", "Home")</
li
>
<
li
>@Html.ActionLink("Contact", "Contact", "Home")</
li
>
</
ul
>
using System.Web;
using System.Web.Optimization;
namespace KendoMobileAppV2
{
public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-1.*"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui*"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/jquerymobile").Include("~/Scripts/jquery.mobile*"));
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
bundles.Add(new StyleBundle("~/Content/mobilecss").Include("~/Content/jquery.mobile*"));
bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.resizable.css",
"~/Content/themes/base/jquery.ui.selectable.css",
"~/Content/themes/base/jquery.ui.accordion.css",
"~/Content/themes/base/jquery.ui.autocomplete.css",
"~/Content/themes/base/jquery.ui.button.css",
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.slider.css",
"~/Content/themes/base/jquery.ui.tabs.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.theme.css"));
// The Kendo JavaScript bundle
bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
"~/Scripts/kendo.web.*", // or kendo.all.* if you want to use Kendo UI Web and Kendo UI DataViz
"~/Scripts/kendo.aspnetmvc.*"));
// The Kendo CSS bundle
bundles.Add(new StyleBundle("~/Content/kendo").Include(
"~/Content/kendo.common.*",
"~/Content/kendo.default.*"));
// Clear all items from the default ignore list to allow minified CSS and JavaScript files to be included in debug mode
bundles.IgnoreList.Clear();
// Add back the default ignore list rules sans the ones which affect minified files and debug mode
bundles.IgnoreList.Ignore("*.intellisense.js");
bundles.IgnoreList.Ignore("*-vsdoc.js");
bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
}
}
}
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
url:
"data.json"
,
dataType:
"json"
,
cache:
false
},
create: {
url:
"addItem.php"
,
type:
"POST"
},
schema: {
model: myDataSource
}
}
});
Hey guys,
I have the Kendo stuff setup with Visual Studio 2012 and MVC 4 and everything seems to be working OK. However, the upload functionality is not working as expected. See the attached image for more details. It doesn't matter where in the application I place the upload, I get the same results. However, if I create a project from the Kendo project template the Upload piece works and I do not get the repeated items placed into the page. More than anything I need to know what I am missing.
Thanks!
<div>
@
using
(Html.BeginForm(
"UploadFile"
,
"Home"
, FormMethod.Post,
new
{ id =
"uploadForm"
+ item.CorrespondenceId.ToString(), enctype =
"multipart/form-data"
})){
@(Html.Kendo().Upload()
.Name(
"files"
).Multiple(
true
)
)
<p>
<input type=
"submit"
value=
"Submit"
class
=
"k-button"
/>
</p>
}
</div>