kendo mobile listview可筛选,始终返回第一条记录
我有剑道ui的移动应用程序!在mobile listview中,我尝试按DocumentNumber字段过滤可过滤记录,但当我开始输入单词datasource总是返回第一个记录时,我遇到了问题。 例如,如果listview有5条文档编号为11、22、33、14、15的记录。当我输入1时,它返回11,22,33,如果我输入33,它返回11kendo mobile listview可筛选,始终返回第一条记录,listview,mobile,kendo-ui,filtering,Listview,Mobile,Kendo Ui,Filtering,我有剑道ui的移动应用程序!在mobile listview中,我尝试按DocumentNumber字段过滤可过滤记录,但当我开始输入单词datasource总是返回第一个记录时,我遇到了问题。 例如,如果listview有5条文档编号为11、22、33、14、15的记录。当我输入1时,它返回11,22,33,如果我输入33,它返回11 function taskTodoAssignment() { dataSource = new kendo.data.DataSource({
function taskTodoAssignment() {
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: '/Mobile/GetExecuteAssignment',
dataType: "json",
type: 'GET',
cache: false
}
},
parameterMap: function (options) {
var parameters = {
take: options.take,
skip: options.skip,
pageSize: options.pageSize,
page: options.page
};
return parameters;
},
requestStart: function () {
startLoadingLoader();
},
requestEnd: function () {
kendo.mobile.application.pane.loader.hide();
},
schema: {
data: function (data) {
return data.Data;
},
total: function (data) {
return data.Count;
},
model: {
id: "TaskId",
fields: {
TaskId: { editable: false, nullable: false },
DocumentNumber: { type: "string" },
DocumentId: "DocumentId",
DocumentDate: { type: "date" },
Author: { type: "text" }
}
}
},
pageSize: 30,
page: 1,
serverPaging: true
});
$("#task-assignment-list").kendoMobileListView({
dataSource: dataSource,
template: $("#task-assignment-template").text(),
filterable: {
field: "DocumentNumber",
operator: "startswith"
},
pullToRefresh: true,
loadMore: true
});
}
谢谢你的帮助!对不起,我的英语不好。我认为loadMore设置有问题,请尝试使用最新版本的kendo mobile js 我尝试使用loadMore:false设置,它正在工作 HTML:
非常感谢。你的建议对我有帮助。但是加载更重要的功能,它必须是!我怎样才能将筛选和加载更多信息放在一起???我在JSFIDLE上看到了您的示例,如果我设置loadMore=true,数据源不会加载,但在我的应用程序中,当loadMore=true数据源加载但筛选总是返回第一条记录时,我会有很多记录,这就是为什么我需要加载更多和可过滤的。你能共享JSFIDLE链接吗?我从剑道演示ui中取了一个例子,但他们使用服务器过滤,但我需要客户端过滤。当我将loadMore设置为false时,这个jsidle是好的,但是当loadMore=true过滤不起作用时,您会在jsidle中看到我的代码吗?你有什么想法吗,那我怎么能决定这个!无论如何,非常感谢你的帮助!!!
<div data-role="view" id="mainView" data-init="loadListView" >
<ul id="listView"></ul>
</div>
<script type="text/x-kendo-template" id="listviewTemplate">
<a > <strong > #:Name# </strong>
<i> #:DocumentNumber#</i></a>
</script>
var app = new kendo.mobile.Application(document.body);
var dataSource = new kendo.data.DataSource({
data:
[{
Name: "Name 11",
DocumentNumber: "11"
},
{
Name: "Name 22",
DocumentNumber: "22"
},
{
Name: "Name 3",
DocumentNumber: "3"
},
{
Name: "Name 33",
DocumentNumber: "33"
},
{
Name: "Name 14",
DocumentNumber: "14"
},
{
Name: "Name 4",
DocumentNumber: "4"
},
{
Name: "Name 144",
DocumentNumber: "144"
}]
});
$("#listView").kendoMobileListView({
dataSource: dataSource,
template: $("#listviewTemplate").html(),
filterable: {
field: "DocumentNumber",
operator: "startswith"
},
pullToRefresh: true,
loadMore: false
});