2

I have been trying to create a resizable div using JQuery UI which will also resize a table contained within the div.

$("#WorkRequests").resizable({
        minWidth: $("#WorkRequests").width(),
        maxWidth: $("#WorkRequests").width(),
        handles: 's',
        resize: function (event, ui) {
            var minRows = 10;
            var rowHeight = 35;
            var rows = $("#tbl-WorkRequests-page-size").val();

            if ((rows * rowHeight) > $("#WorkRequests").height()) {
                if (rows > minRows) {
                    $("tbl-WorkRequests-page-size").val((rows - minRows).toString());
                } else {
                    return false;
                }
            }
        }
    });

However when they resize the div to be too small so that it reaches "return false;" it does not cancel the resize event like with other JQuery ui things. Why?

Also the below line:

$("tbl-WorkRequests-page-size").val((rows - minRows).toString());

Should set the value of a select list, however it does not, why?

2
  • Hi Alex! Can you please post the html code for this. Thanks :) Commented Mar 1, 2011 at 6:12
  • It would be better if you could post the HTML as well. At least the relevant bits. If return false doesn't work, have you tried changing the minHeight value inside the resize method? This would hook jqueryUIs own check methods Commented Mar 1, 2011 at 16:00

2 Answers 2

1

The short answer is: This is not possible because draggable is not correctly implemented. return false should stop the event, but unfortunately this is not correctly implemented for resizable.

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

Comments

0

Turns out on this line

$("tbl-WorkRequests-page-size").val((rows - minRows).toString());

I was missing the #, sorry guys, I should have posted the html.

$("#tbl-WorkRequests-page-size").val((rows - minRows).toString());

Thanks, Alex.

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.