Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Dec 29, 2009 07:25
open dhtmlx forum
title must be changed in dhtmlxgrid

Hello ,

i want to changed the title of particular cell . exmple :- in my dhtmlxgrid column contain value "test" and when i mouse over the cell then it will show me test in block table . i want to changed this title . i want to add some hard code value like "abc" is it possible in dhtmlxgrid or not . if possible then please tell me the link of particular example. or if not possible then please reply me it is not possible.

this is my code plz tell me where i will add your code here as pe your mail below is the solution u give me

<cell title="abc">test</cell>





this is my sample.html filter


var z = new dhtmlXCombo("combo_zone3", "alfa3", 170);
z.loadXML("common/test.php?projid=<?php echo $projIDs;?>");
z.attachEvent("onChange",function() {
var selected_value=z.getActualValue();
projReturn(selected_value);
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("dhtmlxGrid/codebase/imgs/");
mygrid.clearAll(0);
mygrid.setHeader("Check,Add,Del,ShotID,Shotstatus,TaskID,Taskref,Task-Note,Alloted Mandays,UserID,TaskStatus,StartDate,EndDate,Shot Priority,Actual Mandays,Supervisor");
mygrid.attachHeader("#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter, ,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter")
//mygrid.setInitWidths("100,*")
mygrid.setColSorting(" ,  ,,str,str,str,str,str,str,str,str,date,date,int,int,str")
mygrid.setColTypes("ch,link,link,ro,ro,ed,ed,txt,ed,ed,ro,dhxCalendarA,dhxCalendarA,dhxCalendarA,ed,ed");
mygrid.enableSmartRendering(true)
mygrid.enableMultiselect(true)
//mygrid.setDateFormat("%d %b","%Y-%m-%d");
mygrid.init();
mygrid.loadXML("conn.php?projid="+selected_value,calculateFooterValues);
var dp = new dataProcessor("conn.php");
function ValidInteger(value,id,ind){
var regexp= /[a-zA-z]/;
if(value.search(regexp)!=-1)
{
alert("please enter Number Only")
mygrid.setCellTextStyle(id,ind,"background-color:red;");
return false;

}
return value!="";
}

dp.setVerificator(13,ValidInteger);
dp.init(mygrid);


con..php

<?php
$res=mysql_connect("localhost","root","redhat");
mysql_select_db("kanibrainNew1");

require("dhtmlxConnector_php/codebase/grid_connector.php");



$grid = new GridConnector($res);
$grid->enable_log("temp_log",true);
$grid->dynamic_loading(1000);



$grid->dynamic_loading(1000);
$grid->event->attach("beforeRender","my_format");
function my_format($data){
$value = $data->get_value("overDue");
$new_value = "Add";
$data->set_value("overDue",$new_value);
}


$grid->event->attach("beforeRender","delete");
function delete($data){
$value = $data->get_value("difficulty");
$new_value = "Del";
$data->set_value("difficulty",$new_value);
}


$grid->sql->attach("Update","Update shotTaskArtist set userID='{userID}',taskID='{taskID}',TaskREF='{TaskREF}',task_note='{task_note}',manDays='{manDays}',startDate='{startDate}',endDate='{endDate}',task_priority='{task_priority}',supervisorName='{supervisorName}',actualMandays='{actualMandays}' where shotID_new='{shotID_new}' and shot_task_id='{shot_task_id}' ORDER BY shotTaskArtist.shotID_new ASC");



$grid->render_sql("select * from shot,shotTaskArtist where shotTaskArtist.projID=shot.projID and shot.projID='".$_REQUEST['projid']."' and shotTaskArtist.shotID_new=shot.shotID order by shot.shotID asc","shot_task_id","checkEfficiency,overDue,difficulty,shotID_new,shotStatus,taskID,TaskREF,task_note,manDays,userID,taskStatus,startDate,endDate,task_priority,actualMandays,supervisorName");







?>




waiting for reply


Thanks for previous all help


regard
Suraj
Answer posted by dhxSupport on Dec 30, 2009 03:11
To add custom tooltip to the cell you can use set_cell_attribute() method:
$grid->event->attach("beforeRender","add_title");
function add_title($row){
$row->set_cell_attribute("item_nm","title","custom_title");
}

Please find more information here http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxconnector:formatting_changing_data_before_loading
http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxconnector:griddataitem_treegriddataitem_specific