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

mvc List view clicked item

Thread ID:

Created:

Updated:

Platform:

Replies:

123759 Apr 19,2016 04:15 AM UTC Apr 20,2016 11:48 AM UTC ASP.NET MVC 1
loading
Tags: ListView
vivek gupta
Asked On April 19, 2016 04:15 AM UTC

I want to trap the click event of list view item and use the primarykey to make a ajax call how to do

Selvamani Sankarappan [Syncfusion]
Replied On April 20, 2016 11:48 AM UTC

Hi Vivek,

Thanks for Contacting Syncfusion Support,

We have analyzed your query. You can achieve your requirement by using existing clientSideEvent “mouseUp” in ListView component. Get the PrimaryKey value in args and use the key value in Ajax call function. Please refer the following code example:

[cshtml]

@Html.EJ().ListView("listview").ShowHeader(true).FieldSettings(f => f.Text("texts").PrimaryKey("PrimaryKeys")).ClientSideEvents(s=>s.MouseUp("action")).DataSource(Model)


[script]

function action(args) {

        var key = args.itemData.PrimaryKeys; // get the primarykey value

        var text = args.itemData.texts;

        console.log("" + key);

        console.log("" + text);

    }


We have prepared the sample based on this. Please get the sample from the following location:

http://www.syncfusion.com/downloads/support/forum/123759/ze/splitterMVC-670476672

Regards,

Selvamani S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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

;