Sections_View

Hi ,
Here i used dhtmlxscheduler_units.js for my section view .
here my problem is the event which saved in calendar are not displaying in Section View, even i used to create Section also .
----> the section fields are saving in my DB and i am retrieving back to my calendar view except Unit View . i followed my code like this.

{
		name:"custom",
		height:23, 
		type:"select", 
		options:sections, 
		map_to:"section_id"
	}
scheduler.createUnitsView({
		name:"unit",
		property:"section_id",
		list:sections
	});
var sections=[];
	sections[0]={key:"", label:"- Select -"};
	var states=[];
	states[0]={key:"", label:"- Select -"};
	$.ajax( {
		url : jQuery.url.getChatURL("/calendar/ajaxCategory.do"),
		cache : false,
		dataType : 'json',
		success : function(response) {
			var categories = response.categories;	
			if (categories.length >= 1) {				
				for ( var i = 1; i <= categories.length; i++) {					
					sections[i]={key:categories[i-1].id, label:categories[i-1].name};
				}				
			}
			var statesList = response.statesLt;
			if (statesList.length >= 1) {
				for ( var i = 1; i <= statesList.length; i++) {					
					states[i]={key:statesList[i-1].stateCode, label:statesList[i-1].stateName};
				}				
			}
		}
	});

here in my light-box i am getting the all sections .

You have “section_id” in DB table, and in connector’s configuration, right?

Yes, i having Same field section_id.
-----> if i hard coded the section values like this,

var sections=[
	    			{key:1, label:"SreeRam"},
	    			{key:2, label:"Jermey"},
	    			{key:3, label:"Andy"},
	    			{key:4, label:"URT"}
	    		];

The unit View is displaying all the events.
----> i am getting my section_id in my xml also ,
---->in light-box it is showing which section i selected also.

You need to configure you server side code to save and load section_id info for events.

In case of connector it can be done by

  1. adding db field section_id to the event’s table
  2. adding “section_id” to the list of fetched fields. ( third parameter of connector )

If you are using custom server side - be sure that this value is saved in DB and provided in xml during loading

<event id="123"> <section_id>1</section_id> ...

yes , i am getting my final Xml Out-Put in like this,

<data>
−
<event id="8">
<readonly>true</readonly>
<text>Focus Change</text>
<title>dgfhdhdfdfg</title>
<section_id>1</section_id>
<start_date>2010-09-24 00:00:00</start_date>
<end_date>2010-09-24 00:05:00</end_date>
<states>AK</states>
</event>

But still i am not getting events in UnitsView , i am using this code for getting all Section in my select box like this

var sections=[];
sections[0]=[{key:"", label:"- Select -"}];
var states=[];
states[0]={key:"", label:"- Select -"};
$.ajax( {
	url : jQuery.url.getChatURL("/calendar/ajaxCategory.do"),
	cache : false,
	dataType : 'json',
	success : function(response) {
		var categories = response.categories;			
		if (categories.length >= 1) {
			for ( var i = 1; i <= categories.length; i++) {					
				sections[i]={key:categories[i-1].id, label:categories[i-1].name};
			}				
		}
		var statesList = response.statesLt;
		if (statesList.length >= 1) {
			for ( var i = 1; i <= statesList.length; i++) {					
				states[i]={key:statesList[i-1].stateCode, label:statesList[i-1].stateName};
			}				
		}
	}
});

instead using above code if use this one i am getting events in Units-View

var sections=[
		    			{key:1, label:"SreeRam"},
		    			{key:2, label:"Jermey"},
		    			{key:3, label:"Andy"},
		    			{key:4, label:"URT"}
		    		];