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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:12:18+00:00 2026-06-06T02:12:18+00:00

I’m attempting to create a cascading dropdown based on the Knockout.js Cart example but

  • 0

I’m attempting to create a cascading dropdown based on the Knockout.js Cart example but with the Mapping plugin to get my data.

I’ve got the mapping plugin working fine, a template working fine, the first select is good but getting an error on the second one.

Error:

Uncaught Error: Unable to parse bindings.

Message: ReferenceError: PayCodes is not defined;
Bindings value: options:PayCodes, optionsValue:’Value’, optionsText:’Text’, value: $parent.PayCodeId

Changing the line:

<select data-bind="options:PayCodes, optionsValue:'Value', optionsText:'Text', value: $parent.PayCodeId" class='type'></select>

to: (added ‘this” keyword)

<select data-bind="options:this.PayCodes, optionsValue:'Value', optionsText:'Text', value: $parent.PayCodeId" class='type'></select>

fixes the error, but the 2nd select still isn’t working. It never gets any options. The PayCodes array exists, as seen in the attached JSON data.

Here is the fiddle duplicating the issue: http://jsfiddle.net/JLhSx/13/

And the formatted JSON is here in case it helps.

Any suggestions?

EDIT to Original:

Adding

Inside my “with:” section just returns the ID of my PayTypeId, so the “with:” section isn’t getting a full observable array of PayTypes as I expected. How can I refactor this so the first drop down displays a list if PayTypes and the second displays the PayCodes of the selected PayType?

Updated fiddle

Thanks!

  • 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-06T02:12:20+00:00Added an answer on June 6, 2026 at 2:12 am

    Ok, I’ve got it working. Please let me know if there is a better way though.

    Updated fiddle here

    I’ve used a foreach with nested if. This seems a bit hackish or overkill though. Right now I’m just happy it works!

    <td>
        <select data-bind='options:PayTypes, optionsValue:"Id",optionsText:"PayType", value: PayTypeId ' class='type'></select>
    </td>
    <td data-bind="foreach: PayTypes">
        <!-- ko if: (Id() == $parent.PayTypeId())  -->
           <select data-bind="options:PayCodes, optionsValue:'Value', optionsText:'Text', value:$parent.PayCodeId" class='type'></select>
        <!-- /ko -->
    </td>
    

    Better versions without the loop are appreciated and would be certainly marked as answer.

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

Sidebar

Related Questions

i got an object with contents of html markup in it, for example: string
I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

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.