tasmcan / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

Autocomplete inline #95

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I'm looking for a way to do autocomplete in inline edition. But there is no 
function to override when input is created to instanciate the autocomplete 
process.

Have you an idea of a way to do it?

thanks.

Original issue reported on code.google.com by nahuel.a...@revues.org on 4 Mar 2012 at 1:27

GoogleCodeExporter commented 9 years ago
Hi,

Unfortunately this is not supported. Inline editing is done by the JEditable 
plugin and I do not have control over inline editing. As far as I see it does 
not support autocomplete. I don't see it as custom input for JEditable plugin 
so you might try to implement it see 
http://www.appelsiini.net/2008/2/creating-inline-timepicker-with-javascript 

Jovan

Original comment by joc...@gmail.com on 4 Mar 2012 at 7:25

GoogleCodeExporter commented 9 years ago
This can be done with the editable addInputType method.  I've got the following 
code working for me:

In the makeEditable aoCollumns array, for the field in question:

        {
          indicator: 'Saving data...',
          tootip: 'Click to select data value',
          type: "autocompleteData",
          onblur: 'submit',
          sUpdateURL: "/Application/Update",
        },

Then, somewhere in the $(document).ready(function() {

  $.editable.addInputType('autocompleteData', {
    element : $.editable.types.text.element,
    plugin: function (settings, original) {
      $('input', this).autocomplete({
        source: "/Application/AutoComplete?field=xxxx&table=xxx",
      });
    }
  });

/Application is a Perl back-end I have powering the app.  The AutoComplete 
function returns a JSON encoded list of items for the autocomplete.  It gets 
called on every keystroke to narrow down the results.  This is using the 
jQueryUI autocomplete component.

Original comment by steve.ja...@gmail.com on 1 Nov 2012 at 3:33