porno porno rokettube
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Grails, jQuery & the jQuery Grid - Part Four

  1. #11
    Administrator dave's Avatar
    Join Date
    Mar 2010
    Location
    West Yorkshire, UK - Valencia Spain
    Posts
    110
    Hi Anamika,

    What ajax output are you seeing when the save call is made? Are you certain the server is receiving the right data?

    When debugging this sort of task, I tend to add a quick 'println params' as the first line of the controller action I'm testing, and the check the ajax call in the browser. Either by using firebug when I'm using Firefox, or if I'm using Chrome, it has the same functionality built in.
    Connect with me on twitter : @davebrown1975 http://twitter.com/davebrown1975

    Web & Mobile Development by Tucanoo Solutions Ltd

  2. #12
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    I want to change the add function to the default create action from grails, so that the page is called to create a new object with the create page. So if I click the + button i want to redirect to a the default create page from grails.

    Can you tell me how I can manage that?

    The code i have now is:
    // set on click events for non toolbar buttons
    $("#btnAdd").click(function(){
    $("#hond_list").jqGrid("editGridRow","new",
    {addCaption:'Creeer nieuwe hond',
    afterSubmit:afterSubmitEvent,
    savekey:[true,13]});
    });
    Last edited by Ghost; 08-03-2012 at 04:22 PM.

  3. #13
    Administrator dave's Avatar
    Join Date
    Mar 2010
    Location
    West Yorkshire, UK - Valencia Spain
    Posts
    110

    Exclamation

    These days I tend not to use the buttons on the grid navbar itself as I find them too small, so would prefer a big 'Add <name>' button as opposed to the small '+' icon.

    However to do what I think you want, I would first disabled the 'add' button from the pager by setting 'add:false', then I would add a custom button to the pager using the navButtonAdd method. Example:

    Code:
    .navButtonAdd('#Pager',{        caption:"Add", 
            buttonimg:"fullpath/row_add.gif", 
            onClickButton: function(){ window.location("<g:createLinkTo action:'create'/>") }, 
            position:"last"        })
    At least something along those lines, note thats totally untested!

    Check out http://www.trirand.com/jqgridwiki/do...custom_buttons for more info.


    Quote Originally Posted by Ghost View Post
    I want to change the add function to the default create action from grails, so that the page is called to create a new object with the create page. So if I click the + button i want to redirect to a the default create page from grails.

    Can you tell me how I can manage that?

    The code i have now is:
    // set on click events for non toolbar buttons
    $("#btnAdd").click(function(){
    $("#hond_list").jqGrid("editGridRow","new",
    {addCaption:'Creeer nieuwe hond',
    afterSubmit:afterSubmitEvent,
    savekey:[true,13]});
    });
    Connect with me on twitter : @davebrown1975 http://twitter.com/davebrown1975

    Web & Mobile Development by Tucanoo Solutions Ltd

  4. #14
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    The link is on the navgrid but it won't work like this:

    onClickButton: function(){ window.location("<g:createLinkTo class:'create' action:'create'/>") },
    Can you help me futher?

  5. #15
    Junior Member
    Join Date
    Aug 2012
    Location
    Albuquerque
    Posts
    1
    Awesome, this was very helpful. Thanks.

  6. #16
    Junior Member
    Join Date
    Jan 2013
    Posts
    1
    Great Tutorial thanks!

  7. #17
    Junior Member
    Join Date
    Oct 2013
    Posts
    1
    just use below code
    var lastsel2;
    $(document).ready(function() {
    .................
    .................
    onSelectRow:function(id)
    {
    var rowData = jQuery(this).editRow(id,true);
    lastsel2=id;


    }
    ......
    ......
    });

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Forum Design by Tucanoo Solutions Ltd Grails Development Specialists.