0

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

2
  • What does your onSampleResized function do? Commented Jul 10, 2014 at 20:37
  • The second to last line in the function is missing a ; try the code I posted in my answer. Commented Jul 10, 2014 at 21:01

2 Answers 2

1

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();



});
Sign up to request clarification or add additional context in comments.

5 Comments

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; };
We have used this function(onSampleResized) to get width of td and height of tr and saved to db, when i try to access the table after impact i cant resize the table row in chrome
I updated the code and the fiddle. I think this is what you're looking for. The text that is output is formatted a little easier to read. I really think the missing ; was presenting an issue in chrome.
please check this link jsfiddle.net/44fKg/5 <br/> i have saved the tr height to 50px when i tried to reduce adjust the row it is not reduced less than 50px in chrome but it is working perfect in firefox you check it
I see that - it seems to set a minimum height in chrome.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.