diff --git a/imports/client/views/org/admin/students/index.js b/imports/client/views/org/admin/students/index.js index f0d6b76..c19225c 100644 --- a/imports/client/views/org/admin/students/index.js +++ b/imports/client/views/org/admin/students/index.js @@ -27,9 +27,12 @@ const meteorTick = (props, onData) => { const org = Orgs.current(); students = Users.find({"role":"STUDENT"}).fetch() ? Users.find({"role":"STUDENT"}).fetch() : ""; studentData = Students.find().fetch() ? Students.find().fetch() : ""; + var mergedData; + console.log(studentData); for(var i=0; i< students.length; i++){ for(var j=0; j< studentData.length; j++){ - if(students[i]._id == studentData[j].userId){ + if(students[i]._id == studentData[j].userId && studentData[j].admissionId){ + students[i].admissionId = studentData[j].admissionId; students[i].class = studentData[j].class; students[i].dob = studentData[j].dob; } diff --git a/imports/client/views/org/admin/students/view/StudentTable.js b/imports/client/views/org/admin/students/view/StudentTable.js index 379b900..fc56fa1 100644 --- a/imports/client/views/org/admin/students/view/StudentTable.js +++ b/imports/client/views/org/admin/students/view/StudentTable.js @@ -5,10 +5,39 @@ import React, { Component } from 'react'; import { Link,browserHistory } from 'react-router'; import { FormGroup,Panel,Table, ButtonToolbar,Modal, - FormControl,Glyphicon,Button, } from 'react-bootstrap'; + FormControl,Glyphicon,Button, } from 'react-bootstrap'; import {moment} from 'meteor/momentjs:moment' import {StudentRow} from './StudentRow' +import {BootstrapTable, TableHeaderColumn}from 'react-bootstrap-table'; +const options = { + page: 0, // which page you want to show as default + sizePerPageList: [ { + text: '5', value: 5 + }, { + text: '10', value: 10 + }], // you can change the dropdown list for size per page + sizePerPage: 5, // which size per page you want to locate as default + pageStartIndex: 0, // where to start counting the pages + paginationSize: 3, // the pagination bar size. + prePage: 'Prev', // Previous page button text + nextPage: 'Next', // Next page button text + firstPage: 'First', // First page button text + lastPage: 'Last', // Last page button text + paginationShowsTotal: false, // Accept bool or function + paginationPosition: 'bottom' // default is bottom, top and both is all available + // hideSizePerPage: true > You can hide the dropdown for sizePerPage + // alwaysShowAllBtns: true // Always show next and previous button + // withFirstAndLast: false > Hide the going to First and Last page button + }; + +function dateFormatter(cell, row) { + if(cell){ + console.log(cell); + return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`; + } + +} export class StudentTable extends Component { constructor(props) { @@ -26,6 +55,7 @@ export class StudentTable extends Component { togglePanel(){ this.setState({panleOpen: !this.state.panleOpen}); } + render() { return (
First Name | -Last Name | -Class | -DOB | -Status | -Actions | -
---|