KeyTable support for touch screens?

KeyTable support for touch screens?

florincosminflorincosmin Posts: 6Questions: 0Answers: 0
edited July 2013 in KeyTable
Hi,

First of all, thanks for the amazing work you're doing.

I am working on a project where I am using DataTable and KeyTable together with jEditable. I am wondering if is there anything I can do to support touch events for the jEditable plugin. For example when an user wants to edit on mobile devices he will be able to tap on a cell in order to edit that cell and to tap everywhere else to update the cell (some sort of 'esc').

Florin.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    What event does the touch produce? Is it not a 'click' event, and does that not already open the editing cell?

    Allan
  • florincosminflorincosmin Posts: 6Questions: 0Answers: 0
    Hi Allan, I am sorry, I 'made a mistake. I initially tried this example http://datatables.net/release-datatables/extras/KeyTable/editing.html but just know I notice it's not click event but responds to return key. I want to be able to edit the cells on clicks / touch events if mobile.

    I will also try to investigate myself how to change from enter to click events.
  • florincosminflorincosmin Posts: 6Questions: 0Answers: 0
    edited July 2013
    --UPDATE--
    I checked on the web and found this page: http://www.appelsiini.net/projects/jeditable/default.html
    Then I checked its source and found out how to apply .editable() function to react for different events.

    [code]
    /* Apply the jEditable handlers to the table */
    window.oTable.$('td').editable(doEdit, {
    "placeholder" : ' ',
    "height" : "14px",
    "width" : "100%",
    "event" : "mouseover"

    });
    [/code]
    In he above example, the table cell will change to a text input field as the mouse goes over them.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Ah yes - KeyTable uses the click as focus not activate (which is what the return key does).

    Actually thinking about it, what aspect of KeyTable would you want to get on a touch device? Could you just disable it and have jEditable doing its thing on the table as it normally does?

    Allan
  • florincosminflorincosmin Posts: 6Questions: 0Answers: 0
    Hi again, good question!

    I think I will have to try it. I think the "activate" event is perfect for desktops but when going mobile, it's not possible to fire the "activate" events. The way I want to make it is to react at "activate" on desktop and "click/touch" when mobile.
This discussion has been closed.