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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Child ListBox with anew model from controller

Thread ID:

Created:

Updated:

Platform:

Replies:

108894 May 18,2013 05:08 PM UTC May 22,2013 06:08 AM UTC Orubase 4
loading
Tags: Orubase
Yara
Asked On May 18, 2013 05:08 PM UTC

I'm work on asp.net mvc and work on syncfusion tool,

I can bind listbox with model that return from controller method , but I need the following

When I click in the listBox item, a method from controller will be called from javascript and a new model will be return to be viewed as a ChildListBox  to selected item

So, how can I do it with listbox control please

Thanks 


Thivya [Syncfusion]
Replied On May 20, 2013 10:03 AM UTC

Hi Yara,

Thanks for your interest in Orubase product.

You can achieve your requirement by calling action, while clicking the list item using ‘OnItemSelect’ clientside event. Please refer the below code snippets.

//Script

function SendPost(sender, args) {
   $.mobile.changePage("/home/ListboxPost/" + args.Text.toLowerCase());
}

//Controller

public ActionResult ListboxPost(string id) // Which gets the parent items text
{
   products.Clear();
   var data = RenderChildDataSource(id); // Sending new model data for the child item
   return View(data);
}

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

DemoApp.zip

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

Regards,
Thivya.


Yara
Replied On May 21, 2013 08:41 PM UTC

thank you very very much for your response
Example was clear and now I can display child list in a new view 
but I had a problem 
when I select item I can display the selected item in function in JavaScript by using alert , but when I pass it to method in controller the value of it been empty, I don't know why 
note: my items stored in list of string like
List<string> data = new List<string>(new string[size]);
so can you help me 

Yara



Yara
Replied On May 22, 2013 03:22 AM UTC

thank you very much for all your support
my problem solved
Regards


Thivya [Syncfusion]
Replied On May 22, 2013 06:08 AM UTC

Hi Yara,

Thanks for the update. We are glad the issue resolved.

Please let us know if you have any further queries.

Regards,
Thivya.

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

;