@(Html.Kendo().Grid<lobotask.web.ViewModel.TaskViewModel>() .Name("Grid") .Columns(columns => { //columns.Bound(t => t.).Title("ID"); columns.Bound(t => t.Name).Title("Name").Groupable(true); columns.Bound(t => t.Description).Title("Beschreibung").Groupable(false); columns.Bound(t => t.RecipientsText).Title("Empfänger").Groupable(true); columns.Bound(t => t.Status).Title("Status").Groupable(true).Width(100); columns.Bound(t => t.Status).Title("Result").Groupable(true).Width(100); }) .Pageable() .Sortable() // .Resizable(t => t.Columns(true)) .Scrollable() .Filterable() .Groupable() .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("MyTasks", "Tasks")) //.Server() //.Read( ) )
@(Html.Kendo().Grid<
OrderViewModel
>()
.Name("Orders")
.HtmlAttributes(new {style = "height: 400"})
.Columns(c =>
{
c.Bound(p => p.Id).Title("Order ID")
.Groupable(false)
.ClientTemplate((@Html.ActionLink("#=Id#", "Index", "Splits", new { orderId = "#=Id#" }, null).ToHtmlString()));
})
Hi,
Please see my attached screenshot. Each time a user click on the search button, my listview should repopulate with the new results. I have tried the dataSource.read() / refresh() methods in the button click but it’s not working. Any one from telerik, please go through my code and give me a working solution.
CODE
<head>
<title></title>
<script src="Mobile_JS/jquery.min.js" type="text/javascript"></script>
<script src="Mobile_JS/kendo.mobile.min.js" type="text/javascript"></script>
<link href="Mobile_CSS/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="vw_AddTradeRequest" data-role="view" data-title="New Trade Request" data-init="intSecModal">
<header data-role="header">
<div data-role="navbar">
<a data-align="left" data-role="backbutton">Back</a> <span data-role="view-title">
</span>
</div>
</header>
<ul id="lvw_formElement" data-role="listview" data-style="inset">
<li>Security
<ul style="list-style-type:none;"><li><input type="text" style="right:2.2em;"/>
<a data-role="detailbutton" data-rel="modalview" data-icon="more" href="#mvw_SearchSec"></a></li></ul>
</li>
</ul>
<div data-role="modalview" id="mvw_SearchSec" style="width: 90%;">
<header data-role="header">
<div data-role="navbar">
<input id="txt_SearchSecurity"
type="text" style="border: 1px solid Gray;margin-right:0.1em;" data-align="left" value="amgn"/><a data-role="button" id="btn_searchSecurity" data-align="left">Search</a>
<a data-role="button" id="btn_clearSearchSec" data-align="left">Clear</a>
<a data-role="button" data-align="right" data-click="closeSecSearchModalView">Close</a>
</div>
</header>
<ul id="lvw_Search" data-role="listview">
<li>
</li>
</ul>
<ul id="lvw_Security" />
</div>
</div>
<script id="kt_SecurityListTemplate" type="text/x-kendo-template">
<div>
#= SYMBOL #
</div>
</script>
<script id="kt_SecurityHeadTemplate" type="text/x-kendo-template">
<h3> HI</h3>
</script>
<script>
function intSecModal() {
var secData = new kendo.data.DataSource({
transport: {
read: {
url: "mypage.aspx?security=&sm=0&ft=" + $("#txt_SearchSecurity").val(), // the remove service url
dataType: "json"
}
}
});
$("#lvw_Security").kendoMobileListView({
dataSource: secData,
template: $("#kt_SecurityListTemplate").text(),
click: function (e) {
console.log(e.dataItem.SYMBOL);
}
});
$("#btn_searchSecurity").click(function () {
var lvwObjSecurity = $("#lvw_Security").data("kendoMobileListView");
lvwObjSecurity.dataSource.read();
});
$("#btn_clearSearchSec").click(function () { $("#txt_SearchSecurity").val("");});
}
function closeSecSearchModalView() {
$("#mvw_SearchSec").kendoMobileModalView("close");
}
</script>
</body>
Thanks and Regards,
Sibin
<
footer
data-role
=
"footer"
>
<
div
data-role
=
"tabstrip"
>
<
a
>Sign In</
a
>
<
a
>Register</
a
>
</
div
>
</
footer
>
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
x-ua-compatible: IE=EmulateIE7
X-SAS-STP-ERROR: -34
Cache-Control: no-cache, no-store
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Date: Fri, 11 Jan 2013 15:17:29 GMT
result = cache.find(options.data);
if
(result !== undefined) {
success(result);
}
else
{
options.success =
function
(result) {
cache.add(options.data, result);
success(result); // I AM HERE
};
$.ajax(options);
}