Comments (7)
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.
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.
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.
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.
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.
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.
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)
- issue with inline delete redrawing with pagination, only 1st page worksrest ( including searches ) do not redraw table
- Not compatible with jquery higher than 1.9
- Add new row: after first insert, the Cancel button not shown
- Error on Deleted Row
- Only first page of mult-page table is editable. HOT 1
- Delete Button problem HOT 2
- makeEditable() is undefined HOT 1
- Unable to customize buttons HOT 1
- How I can make Editable more of one table
- Patch for /trunk/media/js/jquery.dataTables.editable.js
- Editing AJAX sourced data in the popup window
- Patch for /trunk/media/js/jquery.dataTables.editable.js
- Delete behaving as Post call
- Refresh the table after delete a record
- Refresh the table after delete a record HOT 1
- Missing images for demo_table.css HOT 1
- vgfdzvfz
- editable with responsive HOT 1
- makeEditable() on two tables in the same page HOT 1
- sNewCellDisplayValue is undefined. Typo in variable declaration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-datatables-editable.