0
votes

I have a kendo grid within a kendo window, both bound with knockout and I would like to synchronize their sizes.

Currently the window can be resized but the contained grid only syncs on width, not height.

I've tried adding a resize listener to the binding:

data-bind="kendoWindow: { resize: resizeHandler}"

I've tried adding a binding onto the kendo window like this:

$("#windowId").data("kendoWindow").bind("resize", function () { console.log("resize") });

I've looked at the knockout kendo javascript and found that the resize event was not handled so I tried to add it but without effect:

createBinding({
    name: "kendoWindow",
    events: {
        open: {
        writeTo: ISOPEN,
        value: true
    },
    close: {
        writeTo: ISOPEN,
        value: false
    },
        resize: SIZE
    },
    watch: {
        content: CONTENT,
        title: TITLE,
        isOpen: [OPEN, CLOSE]
    },
    async: true
});
1

1 Answers

0
votes

I've found an existing resize handler in my code. Maybe this was eating the resize event possibly.

if (widget) {
  widget.resize = function() {
      var newWindowHeight = self.queryTableWindow().element.height();
      var newWindowWidth = self.queryTableWindow().element.width();

      self.queryTableWindowHeight(newWindowHeight);
      self.queryTableWindowWidth(newWindowWidth);
  }
}

Could someone close this? I don't think I have enough reputation.