Giter Club home page Giter Club logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
I found a 'workaround' in the mean time (Just need to adjust the #formAddNewRow 
and #btnAddNewRowOk to be whatever might have been passed in for 
sAddNewRowFormId and sAddNewRowOkButtonId)

    $('#formAddNewRow').live('keyup', function(e){
      if (e.keyCode == 13) {
        $('#btnAddNewRowOk').click()
      }
    });

The question still stands, without doing what I did above.. hitting enter will 
just reload the entire page. 
Why? 
What is happening?
Does anyone else see this behaviour?

Original comment by [email protected] on 2 Jun 2011 at 3:18

from jquery-datatables-editable.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
Looks like it is because the form doesn't have any buttons on it and the 
default action is ="#".
So when enter is hit, it submits the form to # (page reload).

Trying to capture the enter key was hit and miss.. 

A more reliable way is this instead.
Unbind .submit for that form, and rebind a new submit that triggers the click() 
on the button.


    $("#formAddNewRow").unbind('submit');
    $("#formAddNewRow").submit(function(){
          //simulate click on create button
          $("#btnAddNewRowOk").click();
          return false;
        });

Original comment by [email protected] on 2 Jun 2011 at 3:57

from jquery-datatables-editable.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
I have reproduced this probelm - I will take a look at this.

Regards,
Jovan

Original comment by [email protected] on 2 Jun 2011 at 4:41

  • Changed state: Accepted

from jquery-datatables-editable.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
FYI. The reason that it isn't happening on the jquery-ui demos is that they 
have a form already in their page defined as <form>. So obviously there is no 
action= attribute, which means that enter just does nothing.

For whatever reason, when you dynamically create the form, the action attribute 
is added to the form and set to ="#". 


Original comment by [email protected] on 2 Jun 2011 at 6:02

from jquery-datatables-editable.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
In the latest version I have placed your code but it does not submit form on 
enter it just ignores ENTER key.

For now this is a temporary fix - at least it does not closes the form. I will 
see why this is happening and how can I submit it on ENTER.

Original comment by [email protected] on 2 Jun 2011 at 6:21

from jquery-datatables-editable.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
Sounds good to me.
Thanks for jumping on the issue. 

Oh, and it wasn't you dynamically adding the action="#"..
I forgot that we are responsible for adding the form to the page.. and we had 
placed that attribute on there..   Still same result.. just wanted to call out 
that I wasn't pointing the figure at you for putting the attribute on there..

-k

-k

Original comment by [email protected] on 2 Jun 2011 at 6:28

from jquery-datatables-editable.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
I'm cosing this issue.
Ignoring ENTER key/submission will be standard feature in this version of 
plugin.

Original comment by [email protected] on 3 Jun 2011 at 5:56

  • Changed state: Fixed

from jquery-datatables-editable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.