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

  • Home
  • SEARCH
  • 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 8522835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:14:21+00:00 2026-06-11T07:14:21+00:00

I have a grid system like this <div class=section table_section> <div class=section_inner id=divTestKoRemoteGrid> <div

  • 0

I have a grid system like this

<div class="section table_section">
<div class="section_inner" id="divTestKoRemoteGrid">
    <div class="title_wrapper" data-bind="with: Grid">
        <h2 data-bind="text: TotalCount">
            Prices</h2>
    </div>
    <div class="section_content">
        <div id="product_list" data-bind="with: Grid">
<!--[if !IE]>start table_wrapper<![endif]-->
<div class="table_wrapper">
    <div class="table_wrapper_inner">
        <table cellpadding="0" cellspacing="0" width="100%">
            <tbody>
                <tr>
                    <th>
                        No.
                    </th>
                    <th>
                        Tier
                    </th>
                    <th>
                    </th>
                </tr>
                <!-- ko foreach: Data -->
                <tr data-bind="css: { second: $index() % 2 }">
                    <td data-bind="text: Id" style="width: 26px;">
                    </td>
                    <td data-bind="text: Tier" style="width: 35px;">
                    </td>
                    <td style="width: 120px;">
                        <div class="actions_menu">
                            <ul>
                                <li><a class="edit" href="">edit</a></li>
                                <li><a class="delete" href="">deny</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
                <!-- /ko -->
            </tbody>
        </table>
    </div>
</div>
<!--[if !IE]>end table_wrapper<![endif]-->
</div>
<!-- ko with: Grid -->
<div class="pagination" data-bind="with: Page">
    <span class="page_no" data-bind="text: TotalCount"></span>
    <ul class="pag_list" data-bind="foreach: ko.utils.range(1, TotalPage)">
        <li><a href="" data-bind="click: $parent.Goto, css:{current_page: $data == $parent.CurrentPage}">
            <span><span data-bind="text: $data"></span></span></a></li>
    </ul>
</div>
<!-- /ko -->
    </div>
</div>
</div>

and Knockout viewmodel

var my = my || {};

$(function () {

my.PriceListViewModel = (function () {

    var 
        grid = ko.observable(),
        loadGrid = function () {
            my.ListModel.LoadData();
            grid(my.ListModel);
        };
    return {
        Grid: grid,
        LoadGrid: loadGrid
    };
})();

my.ListModel = (function () {
    var 
        data = ko.observableArray([]),
        totalCount = ko.observable(),
        page = ko.observable(),
        goTo = function (d) {
            $.getJSON("/prices/GetByFilterViaJSON?limit=6&page=" + d, function (list) {
                data(list.Data);
                page(list.Page);
            });
        },
        loadData = function () {
            $.ajax({
                type: 'GET',
                url: '/prices/GetByFilterViaJSON',
                dataType: 'json',
                success: function (list) {
                    data(list.Data);
                    page(list.Page);
                    totalCount(list.TotalCount);
                },
                data: { limit: 6 },
                async: false
            });
        };
    return {
        Data: data,
        TotalCount: totalCount,
        Page: page,
        GoTo: goTo,
        LoadData: loadData
    };
})();

my.PageModel = (function () {
    var 
        currentPage = ko.observable(1),
        totalCount = ko.observable(1),
        limit = ko.observable(),
        start = ko.observable(),
        nextPage = ko.observable(1),
        previousPage = ko.observable(1),
        totalPage = ko.observable(1),
        loadData = function (pageData) {
            currentPage(pageData.CurrentPage);
            totalCount(pageData.TotalCount);
            limit(pageData.Limit); 
            start(pageData.Start);
            nextPage(pageData.NextPage);
            previousPage(pageData.PreviousPage);
            totalPage(pageData.TotalPage);
        };
    return {
        CurrentPage: currentPage,
        TotalCount: totalCount,
        Limit: limit,
        Start: start,
        NextPage: nextPage,
        PreviousPage: previousPage,
        TotalPage: totalPage,
        LoadData: loadData
    };

})();

my.PriceListViewModel.LoadGrid();
ko.applyBindings(my.PriceListViewModel);
});

When I try to execute GoTo function (in ListModel), browser cant find the function and knockout cant bind in click event.

I try to fix this problem for 5 days. What is the problem you think?

  • 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-11T07:14:23+00:00Added an answer on June 11, 2026 at 7:14 am

    The problem is that you are accessing parent. That would get you Page, not grid, like you need. To fix this problem use parents[]. It contains all parents that are currently available, in your case here, you will want to use parents[1].

    I have a sample fiddle http://jsfiddle.net/Rynan/fthFE/

    also take a look at the documentation on knockout site http://knockoutjs.com/documentation/binding-context.html

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

Sidebar

Related Questions

This is my 960 grid system case: <div class="kundregister_grid_full"> <div class="kundregister_grid_1">ID</div> <div class="kundregister_grid_1">Namn</div> <div
I have a Sublayout called TwoColumns that looks like this: <div class=row> <div class=column
I have grid something like this: Ext.define('Exp.view.dashboard.Tv', { extend: 'Ext.grid.Panel', initComponent: function() { this.columns
I have a grid in a 2D system like the one in the before
I have this datagridtemplatecolumn of mine which I would like to bind to a
I have usercontrols which inherit a base class which looks like this: BasePage.cs: using
I have tweets and commenting system like this This is the code block for
I have a xaml file looking like this. <Window x:Class=Space4it.Energilab.DataApplicationWPF.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:sys=clr-namespace:System;assembly=mscorlib xmlns:local=clr-namespace:Space4it.Energilab.DataApplicationWPF
My problem looks like this. I have a grid with documents (Id's). Now when
I have a hierarcial class like this Part SubPart SubSubPart1 SubSubPart2 I have a

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.