Reputation: 995
I am using both colResizable(for adjusting column) and Resizable function(for adjusting row) it is working good in mozilla firefox but not working in chrome
For column we are using the following link - http://quocity.com/colresizable/
For row we are using following jquery function - $("#tblResize2 tr").resizable();
note : on the above code we tried using td (instead of tr) to resize columns it is not working after the final impact.
$("#MatrixTable").colResizable({
onResize: onSampleResized
});
$("#MatrixTable tr").resizable();
$("#MatrixTable td").resizable();
Whole function
var onSampleResized = function (e) {
var columns = $(e.currentTarget).find("td");
var rows = $(e.currentTarget).find("tr");
var full_msg;
var row_msg;
`columns.each(function () { full_msg += $(this).attr('id') + "_" +` $(this).width() + "_" + $(this).height() + ";"; })
rows.each(function () { row_msg += $(this).attr('id') + "_" + $(this).width() + "_" + $(this).height() + ";"; })
document.getElementById("hf_data").value = full_msg
document.getElementById("hf_rowdata").value = row_msg;
};
Thanks in advance
Upvotes: 0
Views: 1574
Reputation: 1804
I have a working sample here: JSFiddle
I think you have a few issues with the function. There were several missing ;
that chrome may have not liked, try the following.
Full Javascript:
$(function () {
var onSampleResized = function (e) {
var columns = $(e.currentTarget).find("th");
var rows = $(e.currentTarget).find("tr");
var full_msg = "";
var row_msg = "";
columns.each(function () {
full_msg += $(this).attr('id') + ":" + $(this).width() + "x" + $(this).height() + ";\n";
});
rows.each(function () {
row_msg += $(this).attr('id') + ":" + $(this).width() + "x" + $(this).height() + ";\n";
});
document.getElementById("hf_data").value = full_msg;
document.getElementById("hf_rowdata").value = row_msg;
};
$("#MatrixTable").colResizable({
onResize: onSampleResized
});
$("#MatrixTable tr").resizable();
$("#MatrixTable td").resizable();
});
Upvotes: 1
Reputation: 1
Check out the resizable function of the jQuery UI library. You shouldn't even need colResizable. It works with everything. Comes with JS and CSS for resizable items.
http://jqueryui.com/resizable/
Got it working in JSFiddle.
Upvotes: 0