We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to load a dynamic list item in the child page?

Platform: JavaScript |
Control: ejmListView |
Published Date: June 1, 2015 |
Last Revised Date: May 10, 2019

To load the dynamic list item in the child page externally, you can append the listview on demand in the child page of the list item. Refer to the following steps to achieve this.
Since the child list items have to be loaded on demand, you need to write the bind touch event for the list item that needs to be loaded dynamically. The following code example displays the same.

HTML

<div data-role="ejmnavigationdrawer" id="navpane" data-ej-targetid="defaultswipe" data-ej-listviewsettings-datasource="lData" data-ej-listviewsettings-touchstart="touch" />

On touchstart event, you can initiate the required listview with remote databinding. For that, append the listview wrapper in the child list items and initiate the same in the obtrusive way as given in the following code.

<script>
// On touch start of the listview.

function touch(args) {

// DataManager creation.

window.datasource = ej.DataManager({

url: "http://mvc.syncfusion.com/Services/Northwnd.svc/"

});

window.dbitem = { "text": "ShipCity" };

//Creates the div tag with child listview ID.

var list = ej.buildTag('div#' + $(args.item).attr('data-childid') + "_list");

//Appends the children list under the div ID "child_container".

$('#' + $(args.item).attr('data-childid') + "_container").empty().append(list);

//Initializes the child list.

list.ejmListView({ dataSource: window.datasource, fieldSettings: window.dbitem, query: "ej.Query().from('Orders').select('ShipCity').take(5)" })
}
<script>

 

Thus you can load the list item dynamically with remote databinding in the child page.

ADD COMMENT
You must log in to leave a comment
Comments
Jennifer Wright [Syncfusion]
Jun 09, 2015
Test Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon