jQuery UI Widgets Forums Grid Vertical grid

This topic contains 6 replies, has 2 voices, and was last updated by  Dimitar 8 years, 6 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • Vertical grid #78586

    crissi
    Participant

    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!

    Vertical grid #78587

    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Vertical grid #78598

    crissi
    Participant

    Thanks, I’ll check this.

    Vertical grid #78611

    crissi
    Participant

    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!
    Chris

    Vertical grid #78619

    Dimitar
    Participant

    Hi 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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Vertical grid #78635

    crissi
    Participant

    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

    Vertical grid #78675

    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.