Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

How to create related dropdownlists?
michael_petrov
#1 Posted : Monday, February 20, 2012 1:10:40 PM(UTC)
Rank: Newbie
Groups: Registered

Joined: 2/20/2012(UTC)
Posts: 7
Location: Russia
Hi,

I've started to learn Kooboo today and it looks very nice. But I couldn't solve one my small problem. On my edited entity I would like to put two related Dropdownlists like Country and City. The list of cities should be changed depends on countries.
For example if I choose Russia from the first dropdownlist then the second will show me only cities which belong to Russia - Moscow, St.Petersburg and so on. If I choose other country then the cities are reloaded.

How can I create this functionality based on Kooboo?
For now I only can adjust relation for folders but they shows me all items in both dropdownlists.

Thanks
jifeng
#2 Posted : Tuesday, February 21, 2012 3:00:27 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Right now you can custom the content type templates and have to write some ajax requests.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
michael_petrov
#3 Posted : Tuesday, February 21, 2012 8:07:11 AM(UTC)
Rank: Newbie
Groups: Registered

Joined: 2/20/2012(UTC)
Posts: 7
Location: Russia
Hi jifeng,

Thank for your reply. Could you give me some ajax examples or help topic on how to get some entities by id or {UserKey} in your system context? I really impressed the work you have done for that CMS.

Thanks
ella
#4 Posted : Tuesday, February 21, 2012 6:32:27 PM(UTC)
Rank: Advanced Member
ella
Groups: Registered

Joined: 6/30/2011(UTC)
Posts: 57
Location: Russia
Maybe, if your datalist is not very big, you can load all data in comboboxes and use jquery. Like this for example - http://stackoverflow.com/a/5910399
1 user thanked ella for this useful post.
jifeng on 2/22/2012(UTC)
jifeng
#5 Posted : Wednesday, February 22, 2012 1:21:56 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Thank ella, it is recommended. We plan to add a autocomplete control in the future.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
michael_petrov
#6 Posted : Wednesday, February 22, 2012 7:49:02 AM(UTC)
Rank: Newbie
Groups: Registered

Joined: 2/20/2012(UTC)
Posts: 7
Location: Russia
Hi ella, thanks for your reply, but my question is more related to how to fetch data from the folder by some key like ID or UserKey inside template.

For example:

1. I create content type named Hotel.
2. Inside content type Hotel I create dropdownlist named Country and fill it with the data from folder Country.
3. When I look at the code I see that the Value and Text have the same values - just text name of the country and not id and value:

<select>
<option value="England">England<option>
<option value="Russia">Russia<option>
<select>

But actually I would like to have something like:

<select>
<option value="1">England<option>
<option value="2">Russia<option>
<select>

Is it possible? Or I should use Text value as a key to fetch data from other folder.
So, here I would like to implement change event and fetch some data from City folder through ajax and then to fill with this data the other one dropdownlist named City.

It's not a problem to implement some javascript and fill dropdownlist, but It would be nice to have an example on - how to get data by ID from some specific folder in the CMS system?


Thanks
ella
#7 Posted : Wednesday, February 22, 2012 10:07:33 AM(UTC)
Rank: Advanced Member
ella
Groups: Registered

Joined: 6/30/2011(UTC)
Posts: 57
Location: Russia
Unfortunately I didn't try to do what you say. Did you see this sample code (http://wiki.kooboo.com/?wiki=FAQ) of Linq-query for content?
I want to now too how to do the ajax in page of Kooboo. But I think we need to write own module...
michael_petrov
#8 Posted : Thursday, February 23, 2012 11:50:19 AM(UTC)
Rank: Newbie
Groups: Registered

Joined: 2/20/2012(UTC)
Posts: 7
Location: Russia
Hi ella, yes this is what I wanted - some API description etc :) Thanks!

Also I've just installed a VS 2010 and looked into the code so, now it's more convenient then before when I only used online demo.
michael_petrov
#9 Posted : Thursday, February 23, 2012 11:59:23 AM(UTC)
Rank: Newbie
Groups: Registered

Joined: 2/20/2012(UTC)
Posts: 7
Location: Russia
Regarding Ajax from here:

http://forum.kooboo.com/...p-AJAX-with-Kooboo.aspx

There are two ways to develop AJAX service:
1. Create a page with page-plugin. The page output JSON Result except View Result.
2. Create your own controllers, the controllers output json result. And copy to kooboo bin directory. Specify the routing in
the routes.config.
jifeng
#10 Posted : Tuesday, February 28, 2012 10:03:46 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
HI

We have created a CascadingDropdown control in http://koobootoolkit.cod...ontrol/list/changesets, but it only works on Kooboo CMS 3.2.

It is not difficult to create your own CascadingDropdown control run in 3.1 without using CustomSetting(Using const value for "Parent" and "Folder" ). This field is added in 3.2 to allow the use add some custom settings to let the field more configurable.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
ts1111
#11 Posted : Thursday, March 01, 2012 9:18:02 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 8/5/2011(UTC)
Posts: 30
Hi Jifeng

You announced some nice features for release 3.2.
Is there already a release date scheduled for 3.2?

Thanks
Tom
jifeng
#12 Posted : Friday, March 02, 2012 2:51:47 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Yes, very soon.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
1 user thanked jifeng for this useful post.
ella on 3/2/2012(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.609 seconds.