Closed ramonYcajal closed 7 years ago
well done!!!, i just do it but the doc doesn`t help me Now I have more problems, How can I get the position of the cell which has a focus or get de content of it, like getCurrentCellContent or similar, without passing index...
hello!! I solved my problem using mouseclicked from the editablegrid.js and modifying the content to use in my script. $("#table").on('click', function(e){ showPosition(e);
});
function showPosition(e){
e = e || window.event;
with (editableGrid) {
// get row and column index from the clicked cell
var target = e.target || e.srcElement;
// go up parents to find a cell or a link under the clicked position
while (target) if (target.tagName == "A" || target.tagName == "TD" || target.tagName == "TH") break; else target = target.parentNode;
if (!target || !target.parentNode || !target.parentNode.parentNode || (target.parentNode.parentNode.tagName != "TBODY" && target.parentNode.parentNode.tagName != "THEAD") || target.isEditing) return;
// don't handle clicks on links
if (target.tagName == "A") return;
// get cell position in table
var rowIndex = getRowIndex(target.parentNode);
var columnIndex = target.cellIndex;
console.log(rowIndex,columnIndex);
}
}
@ramonYcajal please close the issue if it's already solved.
hello, i don't know how should I install your plugin, links to css and scripts in head, create de grid in body tag and create de script on document ready to generate it and whatever it wants. firs, columns, then data and finally to create an instance of this object. In doc doesn`t explain it and I can't understand watching basic examples. I show gratitude for this help. Thanks