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. Image for the cookie policy date

assign value to list box item in Syncfusion Orubase

I'm work on Orubase Syncfusion in asp.net mvc

I have a list box in my view that has it's value from model from controller , I want to assign for each item specific value to use it in JavaScript

I tried to use

Item.PrimaryKeyValue                              //where PrimaryKeyValue  is integer

And

Item.Value                                                   //where Value  is string

 

 But when I access it in java script by using the following code

function listDetal(sender, args) {

        alert(args.Text.toLowerCase());

 

 

         alert(args.Value);

 

 

    }

Or

         alert(args. PrimaryKeyValue);

 

It gave me undefined value

So, how can I assign values to Items in listbox

Thanks and Regards 


3 Replies

TH Thivya Syncfusion Team May 27, 2013 11:02 AM UTC

Hi Yara,

Please find the below code snippet to get the text and primary key value while selecting the list box items.

//OnItemSelect event
function
select(sender, args) {
   alert("Text : " + args.Text + "Key : " + $(args.selectedItem).attr("data-primarykey"));
}

We have also created sample for the same. Please find the sample in the below attachment.

ListBox.zip

Please try this sample and let us know if you have any queries.

Regards,
Thivya.



YA Yara May 27, 2013 08:12 PM UTC

thank you very much for your response
it Worked for me

Yara


TH Thivya Syncfusion Team May 28, 2013 05:20 AM UTC

Hi Yara,

We are glad to hear it helps. Please let us know if you need any further assistance.

Regards,
Thivya.

Loader.
Live Chat Icon For mobile
Up arrow icon