jQWidgets Forums

jQuery UI Widgets Forums Chart Data-Bind to Description property.

This topic contains 4 replies, has 2 voices, and was last updated by  merseysider85 11 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Data-Bind to Description property. #31173

    Hello there,
    I’m using jqxchart with knockout model-view.
    Recently we decided to bind sales amount to the description of jqxChart slide.

    <div style="width:1024px;height: 750px"> 0) {
    return self.departments()[0].saleAmountToday();
    }
    },
    write: function (value) {
    //nothing
    },
    owner: self
    });

    After investigation i realized that at the first time that “self.amountToday” of view model been called, self.departments() is not initialized yet, and therefore description is “undefined”.

    Right after the first call, there is another call to “self.amountToday”, and now i can see in debug mode that
    self.departments()[0].saleAmountToday() initialized but description is still “undefined”.

    My question is if Description property can handle Data-Bind from knockout model view.

    Data-Bind to Description property. #31174

    I’m sorry, the code not presented well,
    this is the part of the view-model:

    self.amountToday = ko.computed({
    read: function () {
    if (self.departments().length > 0) {
    return self.departments()[0].saleAmountToday();
    }
    },
    write: function (value) {
    //nothing
    },
    owner: self
    });
    Data-Bind to Description property. #31175

    and here is the description call in jqxchart:

    description: amountToday()
    Data-Bind to Description property. #31177

    Peter Stoev
    Keymaster

    Hi merseysider85,

    The description property of jqxChart is not observable so it cannot be bound with KO. If you change that property by code, make sure to call the jqxChart’s “refresh” method after to update the description.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Data-Bind to Description property. #31179

    Thank you so much.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.