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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:47:01+00:00 2026-05-29T09:47:01+00:00

I hava a php variable that contain JSON type data. $list = [{id:10,first_name:first,mi_name:,last_name:last,nick_name:HH}]; and

  • 0

I hava a php variable that contain JSON type data.

$list = [{"id":"10","first_name":"first","mi_name":"","last_name":"last","nick_name":"HH"}];

and I need to use the date for EXT-JS XTemplate.

I tried this way,

var myStore = <?php echo $list; ?>;

var myTpl = new Ext.XTemplate(
    "<div style='text-align:center'>",
    '<tpl for=".">',
        '<p> No : {#}</p>',
        '<p>{first_name} {$last Name}</p>',
    "</tpl>",
    "</div>",
    {}
);

var myPanel = new Ext.Panel({
    border : true,
    layout : 'fit',
    pageY : 10,
    items : new Ext.DataView({
        store : myStore,
        tpl : myTpl,
        autoHeight : true,
        emptyText : 'No Data'
    })
});

but it does not work,

also I tried this,

var myStore = Ext.create('Ext.data.JsonStore', {
    autoLoad : true,
    data : <?php echo $list; ?>
});

it does not work either.

so I tried to get the data using proxy.

var myStore = new Ext.data.JsonStore({
    proxy : new Ext.data.HttpProxy({
        url : './index.php?action=getList' //it return same to $list
    }),
    fields : [
        {name : 'first_name', type : 'string'},
    {name : 'last_name', type : 'string'}
    ],
    autoLoad : true
});

and It works!

Hmm…

so my question is how can I create the data with JSON type php variable.
(I do not want to use proxy to get data if I can)

help me~!

  • 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-29T09:47:02+00:00Added an answer on May 29, 2026 at 9:47 am

    Your dataview is missing the mandatory config “itemSelector”

    For more info, please read the sencha documentation Sencha ExtJS 4 dataview

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

Sidebar

Related Questions

I hava a function that looks something like this: require(config.php); function displayGta() { (...
i hava a class that hold a list for each request but each request
I hava data in an Oracle table that is organized as a graph that
I hava a CSV file that I want to treat as source code. Essentially
I hava a form (form_remote_tag) that updates a comments section. The form is in
I hava a UINavigationController. The first level is a UITableViewController, the second level just
I hava a data window object, in which I am fetching some attributes from
I hava a xml doc (and complex element) that is similar to this example:
I hava a script that consist of hello world and the hello and world
I hava a Tower with the position Vector2 that shoots a target when i

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.