when i show a grid ,yes,the grid is show!
how can i set a popup on a cell?when grid row selected ,popup can show some html content?
when i show a grid ,yes,the grid is show!
how can i set a popup on a cell?when grid row selected ,popup can show some html content?
i meas,when i select one row,it maybe need some check,and check message or informations with the popup…
it’s difficult for me …i have no idea…
alert(“coming this”+grid.cells(id,1));
loadMsgTipPop.attachHTML(endRet);
loadMsgTipPop.show(grid.cells(id,1));-----------------this can’t show popup…
Hi
Try the next piece of code:
function doOnLoad(){
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("dhtmlxGrid_prof/codebase/imgs/");
mygrid.setSkin("dhx_skyblue");
mygrid.attachEvent("onRowDblClicked", function(rId,cInd){
var clicked = mygrid.cells(rId, cInd).cell;
showPopup(clicked, rId)
});
mygrid.loadXML("grid.xml");
}
function showPopup(inp, rId) {
myPop = new dhtmlXPopup();
myPop.attachHTML("You've clicked row with ID "+ rId);
var x = getAbsoluteLeft(inp);
var y = getAbsoluteTop(inp);
var w = inp.offsetWidth;
var h = inp.offsetHeight;
myPop.show(x, y, w, h);
window.setTimeout(function(){
myPop.hide();
}, 2000)
}
Instead “onRowDblClicked” you can use “onRowSelect” event:
docs.dhtmlx.com/doku.php?id=dhtm … owselect&s[]=onrowselect
thanks very much.
You are welcome!
hi,i have a problem again,i am so sorry…
about the method
/---------------------------------------------------------------/
function showPopup(inp, rId) {
myPop = new dhtmlXPopup();
myPop.attachHTML("You’ve clicked row with ID "+ rId);
var x = getAbsoluteLeft(inp);
var y = getAbsoluteTop(inp);
var w = inp.offsetWidth;
var h = inp.offsetHeight;
myPop.show(x, y, w, h);
window.setTimeout(function(){
myPop.hide();
}, 2000)
}
/----------------------------------------------------------------/
how can i set the popup position appears follow my mouse click postion.
i made [myPop.show(x, y, w, h);]----to–>[myPop.show(x-50, y, w, h);] it couldn’t worked.
i need your help,i don’t know you can understand me,my english is not very good…
If you need x-50, you ned follow:
var x = getAbsoluteLeft(inp)-50;
…
myPop.show(x, y, w, h);
i did it ,it didn’t worked…
You can try the next:
var w = inp.offsetWidth-50;
By the way we have update docs about it:
docs.dhtmlx.com/doku.php?id=dhtmlxpopup:show