jQWidgets Forums
Forum Replies Created
-
Author
-
Thanks Peter
What I’m trying to do is when I update my database like updating birth place it will display in combobox by default after refreshing combobox
selectedIndex: 0 <= it will select the very first item
selectedIndex: (I want to assign the very last or highest index that was updated to my birthplace)
Thanks again
Tried to study your code example ‘ Need to create grid columns dynamically from JSON’ can you please explain
var json = ‘[{ “columns”: [{ “text”: “Name”, “datafield”: “name”, “width”: “250” }, { “text”: “Beverage Type”, “datafield”: “type”, “width”: “250” }, { “text”: “Calories”, “datafield”: “calories”, “width”: “180” }, { “text”: “Total Fat”, “datafield”: “totalfat”, “width”: “120” }, { “text”: “Protein”, “datafield”: “protein” }] }, {“rows” : [{“id”: “1”, “name”: “Hot Chocolate”, “type”: “Chocolate Beverage”, “calories”: “370”, “totalfat”: “16g”, “protein”: “14g”}, {“id”: 2, “name”: “Peppermint Hot Chocolate”, “type”: “Chocolate Beverage”, “calories”: “440”, “totalfat”: “16g”, “protein”: “13g”}, {“id”: “3”, “name”: “Salted Caramel Hot Chocolate”, “type”: “Chocolate Beverage”,”calories”: “450”, “totalfat”: “16g”, “protein”: “13g”}]}]’;
How did you retrieve this file before you assigned to –> var json?
Thanks again
Thanks Dimitar for a quick responce
Check the forum that you gave but I don’t understand itThis is a working code that I have right now
$(document).ready(function () {
// prepare the data
var data = {};
var source =
{
datatype: “json”,
datafields: [
{ name: ‘sched_Id’, type: ‘int’},
{ name: ‘Idno’, type: ‘int’},
{ name: ‘subject’, type: ‘text’},
{ name: ‘first_grading’, type: ‘float’},
{ name: ‘second_grading’, type: ‘float’},
{ name: ‘third_grading’, type: ‘float’},
{ name: ‘fourth_grading’, type: ‘float’},
{ name: ‘average’, type: ‘float’}],
id: ‘sched_Id’,
url: ‘Student_Grades.php’,};
// initialize jqxGrid
$(“#jqxgrid”).jqxGrid(
{
width: 700,
height: 350,
selectionmode: ‘singlecell’,
source: source,
theme: ‘fresh’,
columns: [
{ datafield: “subject”, text: “subject”, width: 205 },
{ datafield: “first_grading”, text: “1st Grading”, width: 90, cellsformat: ‘F2’, cellsalign: ‘center’ },
{ datafield: “second_grading”, text: “2nd Grading”, width: 90, cellsformat: ‘F2’, cellsalign: ‘center’ },
{ datafield: “third_grading”, text: “3rd Grading”, width: 90, cellsformat: ‘F2’, cellsalign: ‘center’ },
{ datafield: “fourth_grading”, text: “4th Grading”, width: 90, cellsformat: ‘F2’, cellsalign: ‘center’ },
{ datafield: “average”, text: “Average”, width: 90, cellsformat: ‘F2’, cellsalign: ‘center’ }
]
});
});output:
Subject | 1st Grading | 2nd Grading | 3rd Grading | 4th Grading | Average
English | 80.00 | 85.00 | 80.00 | 90:00 |
Math | 80.00 | 85.00 | 80.00 | 90:00 |
Science | 80.00 | 85.00 | 80.00 | 90:00 |This is what I want to do, all the data in subjects will be the header name and grades of students in each subject.
How can I do this? Any suggestion?Name | English | Math | Science
Student A | 80.00 | 85.00 | 80.00
Student B | 80.00 | 85.00 | 80.00
Student C | 80.00 | 85.00 | 80.00Thanks again!
hello Peter!
A BIG Thanks for a fast reply.
Just to give you an additional info on what I’m doing, I integrate the popup editing to a Nested grid again base on the demo!
so when I click the edit button on the popup editing (I change the edit button to save button) it will save to my database no problem with saving it saves the data. Can you please give me an example on how to do it base on the example demo!Thanks again!
-
AuthorPosts