php - changing grid using extjs4 -



php - changing grid using extjs4 -

i working on extjs 4.2 app in php mysql backend. have json response pupil name, exam, subject, marks in 1 row. same sent mysql database. trying reconfigure grid shown below:

so marks of sem-1 , english language part of 1 record. however, marks of sem-2 , english language part of sec record. far can show subjects , semesters. semesters can shown in grid column reconfigure well. understanding 1 finish record can shown in row. maybe done through grid tpl. can please help me. if changes in json required, can well

currently json {"data":[{"markid":20,"studentid":2,"examname":"semester-1","subject":"science",‌​"maxmarks":100,"marksrecvd":15},{"markid":21,"studentid":2,"examname":"semester-2‌​","subject":"social science","maxmarks":100,"marksrecvd":25}]}

so every subject-semester combination record , can display every record in grid.

however looking combine marks of various semesters in 1 subject...so in way @theshalit right json can b changed , marks displayed in 1 row

you can utilize dataview displaying info using custom layout templates , formatting.

the view uses ext.xtemplate internal templating mechanism, , bound ext.data.store info in store changes view automatically updated reflect changes.

your tpl :

var tabletpl = new ext.xtemplate( '<tpl>'+ '<table class="tableviewdemo" width="100%" height="100%" padding="" border="1">' + '<tr>' + '<td width="50%" height="5%" style="padding-left:2%;">subject</td>' + '<td width="50%" height="5%" style="padding-left:2%;">semester-1 marks</td>' + '</tr>' + '</tpl>' + '<tpl for=".">'+ '<table class="tableviewdemo" width="100%" height="100%" padding="" border="1">' + '<tr>' + '<td width="50%" height="5%" style="padding-left:2%;">{subject}</td>' + '<td width="50%" height="5%" style="padding-left:2%;">{sem1}</td>' + '</tr>' + '</tpl>' );

here simple demo in context requirement : dataview exjs4.2 demo

you can modify tpl accordingly.for more details : ext.xtemplate

php mysql json extjs extjs4

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -