jQuery UI Widgets › Forums › Grid › Vertical grid
Tagged: angular grid, columns to rows, createeditor, geteditorvalue, grid, initeditor, jquery grid, jqxgrid, json, mysql, php, vertical grid
This topic contains 6 replies, has 2 voices, and was last updated by Dimitar 9 years ago.
-
AuthorVertical grid Posts
-
Hello!
I’d like to know if there is a possibility to make a grid vertically?
To get the columns of a mySQL table into lines. Would be great for user settings. Every option is a column of the mySQL and shown as line in the grid.
Finally, 2 columns in the grid: the name of the option and the setting…If not, any other idea how to solve this?
Thanks!
Hello crissi,
Please take a look at the demo Custom Row Editor, which showcases a somewhat similar scenario. We hope it is helpful to you.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Thanks, I’ll check this.
Hello Dimitar,
Well, I think I understand this example with an array as source.
I’d like zu use JSON <- PHP <- MySQL.
Is it possible to use the grideditor options, where in your example the rows are checked to offer special edit/cell formating every row, to name the first column/first row in the grid with “Username”, and the second column/first row with the value from JSON?
If so, I could check my 7 rows what I have and do it like this.
Is there a doku for the GridEditor that I just could not find?Thanks!
ChrisHi Chris,
By using the data adapter plug-in, you can load data retrieved from your MySQL database and then pass it to the grid. Please take a look at the PHP Integration section of the Documentation for help topics on the matter.
The callback functions createeditor, initeditor and geteditorvalue are all documented in the jqxGrid API documentation, under columns.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hello,
The php integration is not the problem.
I’ve prepared the data now in an other way, like this I can use it.But I have a problem with the create/init editor.
In your first example they check in the createEditor in with row they are. Like this I could add an dropdown into my last row, but how to set all the other rows to a “normal” textinput?
This editor offers dropdownlist and numberinput (as far as I can see this)
Would be great if you cold help me there, somehow I don’t get this…Thanks
Hi Chris,
In createeditor you can create whatever type of editor you wish with almost no limitations. In your case, you can do something like this:
var createGridEditor = function(row, cellValue, editor, cellText, width, height) { var numberOfRows = $("#jqxgrid").jqxGrid('getrows').length; // construct the editor. if (row == numberOfRows - 1) { // last row editor.jqxDropDownList({ autoDropDownHeight: true, width: width, height: height, source: ['United States', 'Germany', 'United Kingdom'] }); } else { // other rows var inputElement = $("<input/>").prependTo(editor); inputElement.jqxInput({ width: width, height: height }); } }
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.