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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:17:35+00:00 2026-06-01T02:17:35+00:00

I ve data in the JSON format given below,need to populate the slick grid

  • 0

I ve data in the JSON format given below,need to populate the slick grid columns with the data from cols and rows from values.. Could u please help me with the loops required to do so ….

var response = { "cols" :  ["name", "Precentage", "Year", "Amount"],
"rows": [{
"flag": true,
"values": [" name1", "Precentage1", "year1", "Amount1"]
}
  • 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-01T02:17:37+00:00Added an answer on June 1, 2026 at 2:17 am

    There may be a better way to do this, but you could just loop through and build the data array by hand, something like this:

    var colName;
    var data = [];
    
    for (var i = 0; response.cols.length; i++) {
      colName = response.cols[i];
      for (var j = 0; response.values.length; i++) {
        if (i === 0) data[j] = {};
        data[j][colName] =  response.values[i];
      }
    }
    

    You can then use grid.setData(data) to pass the data into the grid.

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

Sidebar

Related Questions

I have a dynamic json data having the format var cols= { columns :
I have an application which obtains data in JSON format from one of our
I want to convert the given data to JSON format ... please help me
I'm calling a web service and returning the following data in JSON format: [{OrderNumber:12345,CustomerId:555}]
In controller code, I have data in json format data = { 1: {assetId:1,status:true},
I can connect to server and get json data. it is in this format:
I m getting Time data in this format in an JSON Object. created_time: 2012-04-01T15:02:52+0000
Currently, I'm using AsyncTask to handle Http connection and retrieve data as JSON format.
I am getting some data from a database and am encoding it to json:
Given a JSON respond to a form I need to parse through the JSON

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.