|
<ej:ListView ID="ListView1" Height="450" Width="400" DataTextField="Text" EnableCheckMark="true" runat="server" >
</ej:ListView>
<ej:Button runat="server" ID="btn" Text="Save" ClientSideOnClick="onclick"></ej:Button>
<script type="text/javascript">
$(function () {
$("#MainContent_ListView1").ejListView({ fieldSettings: { id: "ID" } }) // include the field Id here
})
function onclick() {
Listobj = $("#MainContent_ListView1").ejListView("instance")
litem = Listobj.getCheckedItems(); // get the checked items
listdata = [];
for (var i = 0; i < litem.length; i++) {
listdata.push(litem[i].getAttribute("data-id")); //take the id/text here, use the data-id/data-text attribute
}
PageMethods.GetData(listdata.toString(), onSucess, onError); // send to server side
}
</script>
|