Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
How to replicate a bootstrap grid screen in ReactJs with the data

I am trying to replicate a set of bootstrap grid screens, so I can embed objects in the exact position. Each screen is custom designed but we have the data for each of the objects in the screen like x,y postion, height (value in %), width (value in %), row, col, colspan and rowspan. We have an array of objects for each screen with the data. Each object is identified by the unique id.

An example screen and array data is below

[{
 bounds: {y: 0, x: 0, width: 100, height: 5.555555555555555}
 col: 0
 colspan: 36
 id: "kUpXjV"
 row: 0
 rowspan: 1
},
{
 bounds: {y: 38.88888888888889, x: 50, width: 25, height: 61.111111111111114}
 col: 18
 colspan: 9
 id: "CfRCPp"
 row: 7
 rowspan: 11
},
{
 bounds: {y: 38.88888888888889, x: 25, width: 25, height: 61.111111111111114}
 col: 9
 colspan: 9
 id: "XEUKJK"
 row: 7
 rowspan: 11
},{
 bounds: {y: 38.88888888888889, x: 0, width: 25, height: 61.111111111111114}
 col: 0
 colspan: 9
 id: "hgjft"
 row: 7
 rowspan: 11
},
{
 bounds: {y: 22.22222222222222, x: 75, width: 25, height: 77.77777777777779}
 col: 27
 colspan: 9
 id: "mpaLGbj"
 row: 4
 rowspan: 14
},
{
 bounds: {y: 5.555555555555555, x: 0, width: 25, height: 33.33333333333333}
 col: 0
 colspan: 9
 id: "LmXFRrD"
 row: 1
 rowspan: 6
},
{
 bounds: {y: 5.555555555555555, x: 25, width: 25, height: 33.33333333333333}
 col: 9
 colspan: 9
 id: "emFBcBy"
 row: 1
 rowspan: 6
},
{
 bounds: {y: 5.555555555555555, x: 75, width: 25, height: 16.666666666666664}
 col: 27
 colspan: 9
 id: "edjZmNm"
 row: 1
 rowspan: 3
},
{
 bounds: {y: 5.555555555555555, x: 50, width: 25, height: 33.33333333333333}
 col: 18
 colspan: 9
 id: "bJvhbjb"
 row: 1
 rowspan: 6

}

An example of the screen im trying to replicate looks likeenter image description here

I tried to arrange the items by position top left in ascending order and then build out the grid from the sorted object, but the sorting is not working correctly and the rendering position of the objects is also mixed up. Would there be another way to accomplish this?

 odata.sort(function (a, b) {
  //sort by x and then by y
  return a.bounds.x == b.bounds.x ? a.bounds.y - b.bounds.y : a.bounds.x- b.bounds.x;
  });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!