а

Cant check the check boxes in a dhtmlx grid


#1

Hi,
Hope somebody can help me with this.I have attached checkboxes to each row in the grid, but those checkboxes cant be checked.Here i attach the code .

Thanks,
Bhavana

var flds3 = "<s:text name=‘VanScheduling.grid.lbl.resid’ />,<s:text name=‘VanScheduling.grid.lbl.trav_name’ />, <s:text name=‘VanScheduling.grid.lbl.postal_code’ />,<s:text name=‘VanScheduling.grid.lbl.pickup_address’ />,<s:text name=‘VanScheduling.grid.lbl.pax’ />,<s:text name=‘VanScheduling.grid.lbl.vanid’ />,<s:text name=‘VanScheduling.grid.lbl.pickup_time’ /> ,<s:text name=‘VanScheduling.grid.lbl.am_pm’ /> ,<s:text name=‘VanScheduling.grid.lbl.timezone’ />,<s:text name=‘VanScheduling.grid.lbl.stopid’ />,

";
	mygrid_travelerToPickup = new dhtmlXGridObject('travelerPickup');
	mygrid_travelerToPickup.imgURL = appPath+"/common/dhxGrid/codebase/imgs/";
	mygrid_travelerToPickup.setHeader(flds3);
	mygrid_travelerToPickup.setInitWidthsP("06,16,08,39,05,06,08,07,08,0,5");
	mygrid_travelerToPickup.setColAlign("left,left,center,left,center,left,left,left,center,center,center");
	mygrid_travelerToPickup.setColTypes("ro,ro,ro,ro,ro,co,edtxt,coro,coro,ro,ch");
	mygrid_travelerToPickup.setColSorting("str,str,str,str,str,str,str,str,str,str,str");
	mygrid_travelerToPickup.setSkin("dhx_skyblue");  
    	mygrid_travelerToPickup.init();
	applicationPath=appPath;
	loadData_travelerToPickup();
	mygrid_travelerToPickup.setOnEditCellHandler(doOnCellEdit_travelerToPickup);

      function loadData_travelerToPickup(){
	 
	
	var combo_vanid =mygrid_travelerToPickup.getCombo(5);
	var combo_timeZone =mygrid_travelerToPickup.getCombo(8);
	combo_timeZone.put("CST","CST");
	combo_timeZone.put("EST","EST");	
	combo_timeZone.put("PST","PST");	
	combo_timeZone.put("MT","MT");	
	
	
	var combo_AMPM =mygrid_travelerToPickup.getCombo(7);
	combo_AMPM.put("AM","AM");
	combo_AMPM.put("PM","PM");
	var i=1; 
	var timeHH=0;
	var timeMM="";
		
	var i2=1; 
	
	var seatsold_pick=parseInt('<s:property value="vanAssignment_seatsold" />');
    
    <s:if test="null != travelerPickupVan">
	<s:iterator value="travelerPickupVan" status="a">
  		<s:iterator value="travelerPickupVan[#a.index].get(0)">
  		mygrid_travelerToPickup.addRow(i2,"",i2);

  		mygrid_travelerToPickup.cells(i2,0).setValue('<s:property value="travelerPickupVan[#a.index].get(0)"/>');
  		mygrid_travelerToPickup.cells(i2,1).setValue('<s:property value="travelerPickupVan[#a.index].get(1)"/>');
  		mygrid_travelerToPickup.cells(i2,2).setValue('<s:property value="travelerPickupVan[#a.index].get(2)"/>');
  		mygrid_travelerToPickup.cells(i2,3).setValue('<s:property value="travelerPickupVan[#a.index].get(3)"/>');
  		mygrid_travelerToPickup.cells(i2,4).setValue('<s:property value="travelerPickupVan[#a.index].get(4)"/>');
  		mygrid_travelerToPickup.cells(i2,5).setValue('<s:property value="travelerPickupVan[#a.index].get(6)"/>');
  	 if('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(0,1)>=1)
  	{
  			timeHH =parseInt('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(0,2));
  			
  	}
  	else if('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(0,1)<1)
  	{
  			timeHH =parseInt('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(1,2));
  		
  	}
  	
  	
  	 if(timeHH<12)
		{
 	  		mygrid_travelerToPickup.cells(i2,7).setValue("<s:text name='VanScheduling.grid.lbl.am' />");
		}
		else{
			mygrid_travelerToPickup.cells(i2,7).setValue("<s:text name='VanScheduling.grid.lbl.pm' />");
			}
			if(timeHH>12){
  	    timeHH=timeHH-12;
			}
			/*if(timeHH==0){
	 	 	  	   timeHH=12;
	 					}*/
	 
	 		if('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(0,1)==0)
			{
			timeHH ="0"+parseInt('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(1,2));									
							
			}else{
				if('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(0,2)>12){
					time24HH=('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(0,2))-12;
					if(time24HH<10){
					timeHH="0"+time24HH;
					}
					}else{
				timeHH =parseInt('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(0,2));
					}
				}
	 		
			timeMM='<s:property value="travelerPickupVan[#a.index].get(7)"/>'.substring(3,5);
			if('<s:property value="travelerPickupVan[#a.index].get(7)"/>'.length==0)
			{
	 	  		mygrid_travelerToPickup.cells(i2,6).setValue("00:00");
	 	  		mygrid_travelerToPickup.cells(i2,7).setValue("<s:text name='VanScheduling.grid.lbl.am' />");
			}
			else{
  		mygrid_travelerToPickup.cells(i2,6).setValue(timeHH+":"+timeMM);
			}
			if('<s:property value="travelerPickupVan[#a.index].get(11)"/>'.length==0)
			{
	 	  		mygrid_travelerToPickup.cells(i2,8).setValue("<s:text name='VanScheduling.grid.lbl.cst' />");
				
			}else{
 	  		mygrid_travelerToPickup.cells(i2,8).setValue('<s:property value="travelerPickupVan[#a.index].get(11)"/>');
			}
 	  		 				
  		mygrid_travelerToPickup.cells(i2,9).setValue('<s:property value="travelerPickupVan[#a.index].get(5)"/>');
  		mygrid_travelerToPickup.cells(i2,10).setValue();
  		i2++;
		</s:iterator>
		</s:iterator> 
	</s:if>
	if((i2==1)&&(seatsold_pick>0))
	{
		tassign_pickup="0";
		al="<s:text name='VanScheduling.alert.no_trav_schedule_van' />";
		
	}
	else  if((i2==1)&&(seatsold_pick<1)){
		tassign_pickup="1";
		al="<s:text name='VanScheduling.alert.assign_traveler' /> ";
		
	}
 

    <s:if test="null != vanDetails_travelerPickupVan">
	<s:iterator value="vanDetails_travelerPickupVan" status="a1">
  		<s:iterator value="vanDetails_travelerPickupVan[#a1.index].get(0)">
 	  	 
  		combo_vanid.put('<s:property value="vanDetails_travelerPickupVan[#a1.index].get(0)"/>','<s:property value="vanDetails_travelerPickupVan[#a1.index].get(0)"/>'); 		   
  	 
  		
		</s:iterator>
	 </s:iterator> 
	</s:if>
	mygrid_travelerToPickup.setColumnHidden(9,true); 

    }

#2

Please, make sure that you return true from your doOnCellEdit_travelerToPickup() function.

If the problem still occurs for you please, provide with a complete demo, where the problem can be reconstructed locally.
Here you can find a tutorial about creating a complete demo:
docs.dhtmlx.com/tutorials__auxi … pport.html


#3

hi,
Thank you, it works.

Thanks,
Bhavana