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 6191317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:44:33+00:00 2026-05-24T02:44:33+00:00

I need to integrate between KnockoutJS with YUI. I have some view models created

  • 0

I need to integrate between KnockoutJS with YUI. I have some view models created with KnockoutJS that have observables and observable arrays. I would like to use the YUI DataTable to edit the data while also preserving the observable behavior.

The basic requirement is for YUI to set properties using a function like myViewModel.personName('Mary') instead of myViewModel.personName = Mary and get properties like myViewModel.personName() instead of myViewModel.personName

Do you have an example of something like this working? If not, should I subclass YAHOO.util.DataSource or should I implement this with a YAHOO.widget.DataTable.Formatter and implementing the editorSaveEvent?

For this integration to be interesting, the YUI widgets would be refreshed when the underlying observable is updated and vice versa. This requirement rules out using YAHOO.util.DataSource.TYPE_JSARRAY or YAHOO.util.DataSource.TYPE_JSON in the straightforward way.

Please let me know if you have an example of this or if you can point me to the right place in YUI to hook.

  • 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-05-24T02:44:34+00:00Added an answer on May 24, 2026 at 2:44 am

    I got something working. I’m using a formatter like this:

    var observableFormatter = function(elLiner, oRecord, oColumn, oData) {
            elLiner.innerHTML = oData();
    };
    

    And an editor like this:

    var lang = YAHOO.lang;
    
    YAHOO.namespace('SAMPLE');
    
    YAHOO.SAMPLE.ObservableCellEditor = function(oConfigs) {
        YAHOO.SAMPLE.ObservableCellEditor.superclass.constructor.call(this, oConfigs);
        YAHOO.SAMPLE.ObservableCellEditor.prototype.resetForm = function() {
            this.textbox.value = this.value();
        };
        YAHOO.SAMPLE.ObservableCellEditor.prototype.save = function() {
            // Get new value
            var inputValue = this.getInputValue();
            var validValue = inputValue;
    
            // validation code removed. Not needed for this sample.
    
            var oSelf = this;
            var finishSave = function(bSuccess, oNewValue) {
                var oOrigValue = oSelf.value;
                if (bSuccess) {
                    // Update observable with the new value             
                    oSelf.value(oNewValue);
    
                    //trigger the data table to redraw               
                    oSelf.getDataTable().updateCell(oSelf.getRecord(), oSelf.getColumn(), oSelf.value);
    
                    // Hide CellEditor
                    oSelf._hide();
    
                    oSelf.fireEvent("saveEvent", {
                        editor: oSelf,
                        oldData: oOrigValue,
                        newData: oSelf.value
                    });
                }
                else {
                    oSelf.resetForm();
                    oSelf.fireEvent("revertEvent", {
                        editor: oSelf,
                        oldData: oOrigValue,
                        newData: oNewValue
                    });
                }
                oSelf.unblock();
            };
    
            this.block();
            if (lang.isFunction(this.asyncSubmitter)) {
                this.asyncSubmitter.call(this, finishSave, validValue);
            }
            else {
                finishSave(true, validValue);
            }
        };
    };
    
    YAHOO.lang.extend(YAHOO.SAMPLE.ObservableCellEditor, YAHOO.widget.TextboxCellEditor);
    

    I have a live sample here:

    http://jsfiddle.net/chrisschoon/pLPfw/

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

Sidebar

Related Questions

I need to integrate some legacy 32-bit code - for which I don't have
I have figured out that to integrate calls between Apache HTTP server and Restlet,
I have recently taken on a project in which I need to integrate with
I have developed a window application in VS2005 using C#. I need to integrate
I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code
I need to integrate a email client in my current python web app. Anything
I need to integrate the functionality of creating dynamic pages (like google sites) to
In my asp.net application i need to integrate a jquery content slider with next,
I am working on an application where I need to integrate the search engine.
Need a Math Editor to integrate to my application written on C# to be

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.