javascript problem in webpart [modified]
-
Hello All, I have a datagrid control on webpart, in which I am displaying two out of six columns from a dataset. When somebody click on one row, I want to display all six values for that row on the same webpart without postback. i made this datagrid clickable. i m passing value using the following code. public void dgSpeakerEvents_ItemDataBound(object sender, DataGridItemEventArgs e) { if(e.Item.DataItem!=null) { e.Item.Attributes.Add("onmouseover","this.style.cursor='hand'"); e.Item.Attributes.Add("onclick","ShowDetails('"+ DataBinder.Eval(e.Item.DataItem, "TOPIC_NM").ToString()+ "','"+ DataBinder.Eval(e.Item.DataItem, "CITY").ToString()+ "','"+ DataBinder.Eval(e.Item.DataItem, "STATE").ToString()+ "');"); //e.Item.Attributes.Add("onmouseout", "HideTooltip();"); } } but when i clicked on datagrid, it shows an error: object expected. i checked in the html source code generated by the browser, values passing correctly. my javascript function is :
function detail() { function ShowTooltip(name,city,state) { document.getElementById('td0').innerText=name; document.getElementById('td1').innerText=city; document.getElementById('td2').innerText=state; X=event.clientX+document.body.scrollLeft; Y= event.clientY + document.body.scrollTop + 10; Popup.style.display='block'; Popup.style.left = X; Popup.style.top = Y; } } function HideTooltip() { Popup.style.display='none'; } If any body can suggest me with good example.Thanks. Dhruvil -- modified at 16:53 Monday 19th June, 2006