This is a migrated thread and some comments may be shown as answers.

How to prevent the first binding on page load of ListView MVC

6 Answers 379 Views
ListView
This is a migrated thread and some comments may be shown as answers.
mo2011ti
Top achievements
Rank 1
mo2011ti asked on 29 Aug 2012, 09:44 AM
Hi,

I'm Using ListView MVC Wrapper and i want to prevent the first binding on page load

i try to use e.preventDefault() in the RequestStart of the DataSource Event of the ListView, this is not working
i cant fint .AutoBind(false) Like the DropDownList control Has....

i didnt find nothing in the documentation or forums both ListView and DataSource

Thanks
var g_firstLoading = true;
function ListView_RequestStart(e) {
if (g_firstLoading) {
e.preventDefault()
g_firstLoading = false;
return;
}
}

6 Answers, 1 is accepted

Sort by
0
Nohinn
Top achievements
Rank 1
answered on 29 Aug 2012, 11:27 AM
Maybe the wrapper is not up to date and it does not have the autobind option (I don't know for sure).
But if you want it asap, the kendo ui framework does have an autoBind option for the listview.
The only drawback is that you should write yourself the html code for the control and the javascript code.
0
mo2011ti
Top achievements
Rank 1
answered on 29 Aug 2012, 11:54 AM
Thanks for your answer.
i do use the latest build of kendo UI.

if i can use on  page load

var listObj = $("#MyListView").data("kendoListView");
listObj.options.autoBind = false;

but listObj in undefined on page load...

if there is a way to set this before the RequestStart Happened.



0
Nohinn
Top achievements
Rank 1
answered on 29 Aug 2012, 11:59 AM
You should create the control via javascript not with the wrapper:
$("#MyListView").kendoListView({
    dataSource: {
        transport: {
            read: {
                url: 'yoururlhere'
            }
        }
    },
    autoBind: false
});
This would be a very basic listview, it would create the control but no data would be retrieved until you call the read method of the dataSource.
0
mo2011ti
Top achievements
Rank 1
answered on 29 Aug 2012, 12:08 PM
i know that, but i'm using the MVC wrapper for some reasons.

i wish the Kendo Team will response to that issue and maybe they will have a solution for that
or maybe they can publish new build of the Kendo UI for MVC that solve that issue

Thanks for your response
0
Accepted
Nikolay Rusev
Telerik team
answered on 03 Sep 2012, 10:46 AM
Hello Mordehay,

.AutoBind(false) was recently added to ListView wrapper configuration. You can try with latest internal build where this options should be available.

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
mo2011ti
Top achievements
Rank 1
answered on 03 Sep 2012, 10:51 AM
Hello Nikolay,

That is great! i'll try it soon

Thanks for the quick response to add this feature.

Best Regards,

Moti

Tags
ListView
Asked by
mo2011ti
Top achievements
Rank 1
Answers by
Nohinn
Top achievements
Rank 1
mo2011ti
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or