Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9097347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:05:21+00:00 2026-06-17T00:05:21+00:00

I am using RPNiemeyer`s kendo-knockout library. I have a kendo window: HTML: <div data-bind=kendoWindow:

  • 0

I am using RPNiemeyer`s kendo-knockout library. I have a kendo window:

HTML:

<div data-bind="kendoWindow: {isOpen: isOpen, title:'Language', width: 400, height: 200, modal: true, widget: popUpWindow }" > 

JavaScript part that centers the window:

this.popUpWindow = ko.observable();
    self.isOpen.subscribe(function (newValue) {
        if (newValue) {
            self.popUpWindow().center();
        }
    });

I am using the source code from my previous question for my fiddle:

Kendo-Knockout: Window does not close correctly

I am following the steps shown here:

Kendo-Knockout: How to center window

I am defining the widget observable but when I want to use it it is not filled with the actual widget.

Fiddle:
http://jsfiddle.net/dcYRM/15/

Any help with working example will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:05:22+00:00Added an answer on June 17, 2026 at 12:05 am

    Looks like there are a couple of issues:

    First, your isOpen subscription is running before the widget has been filled.

    Secondly, after filling the widget, it is causing the datasource to get refreshed and is trying to serialize the model including the widget, which is causing an issue. This is ultimately because Knockout-Kendo is a little too aggressive about unwrapping the data passed to the grid.

    I see two pretty easy ways to fix the issue. The easiest way is to set up a global handler for the widget’s open event and call center on it.

    Putting this with the close event from a previous question would look something like:

      ko.bindingHandlers.kendoWindow.options = {
        close: function() {
          $('.k-window, .k-overlay').remove();
        },
        open: function(event) {
           event.sender.center();
        }
      };
    

    Now, whenever any window is opened it will get centered and you don’t need to mess with the widget at all. Sample here: http://jsfiddle.net/rniemeyer/F4JGG/

    That looks like the best option. To make it work with the reference to the widget itself, you will need to workaround an issue in the library. As mentioned above, it is a little too aggressive and unwrapping the options and it appears that this causes an issue when a widget is initialized, the widget parameter is passed, and it is already filled with a widget. I should be able to address it in the library, when I get a chance.

    Otherwise, you would have to do:

    self.popUpWindow = ko.observable();
    self.popUpWindow.subscribe(function (widget) {
      if (widget) {
        widget.center();
        self.popUpWindow(null); //hack - Knockout-Kendo should handle this one
      }
    });
    

    So, clear the observable after you called center on it. Here is a sample: http://jsfiddle.net/rniemeyer/PVMjy/. I also subscribed to the widget’s observable itself, so that there is not the timing issue with isOpen as mentioned above.

    Setting the global open handler, seems like the cleanest and best option in this case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using RPNiemeyer kendo-knockout library. I have a grid. When the user clicks
I am using RPNiemeyer`s kendo-knockout library. I have two nested bindings. I am using
I am using RPNiemeyer`s Knockout-Kendo.js library. I have a kendoui tabstrip. I looked through
I am using RPNiemeyer`s kendo-knockout library. I have a kendo grid with a kendo
I am using RPNiemeyer kendo-knockout library. I have three view models that instantiate each
I populated the Kendo Combox using KnockoutJS. I am using Knockout-Kendo.js to do that.
I have a checkbox bound to my KOJS model. <input type=checkbox data-bind=checked:settings.remember> I'm trying
Using SolrNet for querying & faceting. I have a combination of int, tdate and
Using php's DOMDocument->LoadHTMLFile('test.html'); keeps on returning an error to me, reporting for an error
Using MATLAB, you have to start with a uniform distribution between (0,1). You need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.