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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:11:05+00:00 2026-05-26T01:11:05+00:00

a simple table contains – id , name , text . I need to

  • 0

a simple table contains – id, name, text.
I need to bring these data in the grid with the grouping by the field name.
In all the examples that I found (for example – paper) uses the variable already defined the data. And I need to get data from Store.

ExtJs 3

The code:

    Ext.onReady(function() {
    var store = new Ext.data.JsonStore({
        url           : 'get_from_db.php',
        storeId       : 'MyStore',
        totalProperty : 'totalCount',
        idProperty    : 'id',
        remoteSort    : true,
        fields : [ 
            {name : 'id',   type : 'int'},
            {name : 'name', type : 'String'},
            {name : 'text', type : 'String'}
        ]
    });
    store.load();

    var TestReader = new Ext.data.JsonReader({  
        idProperty : 'id',
        fields     : [
            {name : 'id',   type : 'int'},
            {name : 'name', type : 'String'},
            {name : 'text', type : 'String'}
        ]
    });


    var TestStore = new Ext.data.GroupingStore({
        reader    : TestReader,
        data      : 'get_from_db.php',
        sortInfo  : {
            field     : 'id',
            direction : 'ASC'
        },
        groupField : 'name'
    });


    var TaskGrid = new Ext.grid.GridPanel({
        store   : TestStore,
        columns : [
            {id : 'id',   header : 'Id',   dataIndex : 'id'},
            {id : 'name', header : 'Name', dataIndex : 'name'},
            {id : 'text', header : 'Text', dataIndex : 'text'}
        ],

        view    : new Ext.grid.GroupingView({
            forceFit     : true,
            groupTextTpl : '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
        }),

        frame        : true,
        width        : 700,
        height       : 450,
        collapsible  : true,
        animCollapse : false,
        title        : 'Grouping',
        renderTo     : document.body
    });
});

As a result, output grid without a single error, the group is – but here’s the column values – all zeros

  • 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-26T01:11:05+00:00Added an answer on May 26, 2026 at 1:11 am

    post the code of ‘get_from_db.php’, if you can, please.

    $connect = mysql_connect(‘localhost’, ‘root’, ”); if ($connect) mysql_select_db(‘grid’) or die(‘error with select table’); $select = mysql_query(“select * from test”); while ($rec = mysql_fetch_array($select)) $rows[] = $rec; echo json_encode($rows);

    You made mistake in returning JSON. Instead

    $rows[] = $rec;

    you need

    $rows[] = array (“id”=>$rec[‘id’], “name”=>$rec[‘name’], “text”=>$rec[‘text’]);

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

Sidebar

Related Questions

I have a simple data table which contains dynamic form text fields. Each field
I need a simple table with a user name and password field in MySQL.
I have a table called orders this table contains all the information we need.
I am designing a very simple table that contains a data element's properties. This
Say I have a simple table that contains username, firstname, lastname. How do I
I have a simple MySQL table thats contains a list of categories, level is
I have two simple tables in my database. A card table that contains Id,
Say you've got two simple table cells next to each other. One contains a
I'm creating a simple mysql table that contains an id, firstname, lastname and an
I have an example of a simple HTML table that contains a number of

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.