jQWidgets Forums

jQuery UI Widgets Forums Grid Use Grid as input to db

Tagged: ,

This topic contains 7 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 5 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • Use Grid as input to db #63545

    sakthisainath
    Participant

    Can anyone explain how to use our jqxgrid as input to the db?

    I mean, while loading the page, I will load an empty grid with 10 rows and 5 columns. Now I fill the rows with data and if I click ‘Add’ button, all the 10 rows in the grid must be inserted into my db. How can I achieve this in our grid?

    Use Grid as input to db #63549

    Peter Stoev
    Keymaster

    Hi sakthisainath,

    jqxGrid has method called “getrows” which returns all rows displayed in the Grid as a JavaScript Array. Then using the jQuery’s AJAX function, you can make an ajax call to your server and pass that Rows array as parameter. On your Server’s script, you’ll have to write logic for adding these rows to the DB.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Use Grid as input to db #63554

    sakthisainath
    Participant

    Thanks Peter Stoev,

    But how to load a empty grid in my page and fill the rows with the data I want?

    Use Grid as input to db #63558

    Peter Stoev
    Keymaster

    Hi sakthisainath,

    You can use the “addrow” method for adding rows in the Grid.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Use Grid as input to db #63559

    sakthisainath
    Participant

    Ya I understand Peter,

    But my question is how to load an empty grid with no values while loading the page?

    Use Grid as input to db #63562

    Peter Stoev
    Keymaster

    Hi sakthisainath,

    To load empty grid with no values, you may set its source property to null. Example: http://jsfiddle.net/bgzzp492/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Use Grid as input to db #63566

    sakthisainath
    Participant

    Sorry Peter, I know I’m disturbing you a lot.

    Now I’ve loaded an empty grid. Consider there are 3 editable columns (Firstname,lastname,age).

    Initially the grid is empty.

    Now, I start entering values for firstname(Sakthi),lastname(Sainath),age(24) in the grid that is displayed.

    Now, I have a button called ‘Save’. When I click Save, I want to retreive all the 3 values, so that I can store them in a separate variable and insert into my DB.

    How to get all the 3(Firstname,lastname,age) values entered in the grid during runtime?

    Use Grid as input to db #63578

    Peter Stoev
    Keymaster

    Hi sakthisainath,

    By using “getrows” again. It returns an array of rows. That array contains All your Grid data values.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.