Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by shawn on Nov 17, 2009 10:10
open dhtmlx forum
Loading and saving value from a select list - dhtmlxscheduler

I have setup the scheduler and wanted to add a select list for type of event (Holiday,game, etc..). Then based on event i set different css styles . Here is the lightbox code:

scheduler.config.lightbox.sections = [
    { name: "title", height: 50, map_to: "text", type: "textarea", focus: true },
    { name: "description", height: 150, type: "textarea", map_to: "details" },
    { name: "type", height: 30, type: "select", map_to: "type",
        options:[
            {key:"1",label:"Type 1"},
            {key:"2",label:"Type 2"},
            {key:"3",label:"Type 3"}
        ]},
    
    { name: "time", height: 72, type: "time", map_to: "auto" }
]

Then in the connector:

SchedulerConnector = new dhtmlxSchedulerConnector(
"Events"
, "EventID"
, dhtmlxDatabaseAdapterType.SqlServer2005
, ConfigurationManager.ConnectionStrings["SamplesDatabase"].ConnectionString
, "FromDate"
, "ToDate"
, "Title as text, Details as details, Type"

When I run the code the type is not set and if i change it and reload the page it has not saved. What do i have to add to load/persist to the database?
Answer posted by Stanislav (support) on Nov 18, 2009 01:53
You can try to change it as 
, "Title as text, Details as details, Type as type"

The case of name does matter, it must be the same in connector and in js configuration. 
Answer posted by shawn on Nov 18, 2009 14:17
Thanks for the reply Stanislav. I can't believe I overlooked that.
That got the type loading but the events were not persisting to the database, both new and updated. I figured out that was due to the order of the .js files, I was loading the scheduler before the connector.

Thanks Again.