Editor - Adding rows WITHOUT the form

Editor - Adding rows WITHOUT the form

eurosolleurosoll Posts: 13Questions: 7Answers: 0

Hi

Just checking out the editor and I apologise if this is a newbie question.

I want to be able to add rows and then edit them inline without the form appearing.

I saw that there is a editor.create() function, but could not work out how to use it. Is there a simple example that I could follow?

Thanks

Dov

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 8,661Questions: 0Answers: 1,449
    Answer ✓

    Hi @eurosoll ,

    This here should do the trick. It's creating a new empty row, then inline editing it immediately.

    Hope that works for you,

    Cheers,

    Colin

  • eurosolleurosoll Posts: 13Questions: 7Answers: 0

    Thanks Colin. Just what I was looking for.

  • hnhegdehnhegde Posts: 68Questions: 17Answers: 0

    Hi @colin ,
    In the above example, if I click "make empty" and then hit 'Esc' key, a blank row remains. Any idea how to make it go away? Here is a loom showing that.
    Kindly advise,

    Thanks,
    Harsha

  • colincolin Posts: 8,661Questions: 0Answers: 1,449

    Hi @hnhegde ,

    With that example, the purpose was to create the empty row. If you want to remove it, you could flag the removal in preBlur, then remove it in closed - something like this.

    Cheers,

    Colin

  • rf1234rf1234 Posts: 1,444Questions: 50Answers: 195

    Interesting solution for this, Colin. I did it server side by only (re)loading empty rows that have a timestamp not older than a few seconds. In addition I have a nightly cleanup run deleting empty rows.

  • hnhegdehnhegde Posts: 68Questions: 17Answers: 0

    Excellent! Thanks @colin !

    Regards,
    Harsha

  • hnhegdehnhegde Posts: 68Questions: 17Answers: 0

    Hi @colin,
    onEsc also seems to accept a function. I tried this one and it works:

    onEsc: function () {                        
        editor.remove(table.row(':eq(0)', false)); }
    }
    
  • colincolin Posts: 8,661Questions: 0Answers: 1,449

    Nice, that's a better solution!

  • hnhegdehnhegde Posts: 68Questions: 17Answers: 0

    Hi @colin ,
    In this example, tab key doesn't seem to work. Shouldn't the edit jump to the next field when I hit tab?

    Regards,
    Harsha

  • colincolin Posts: 8,661Questions: 0Answers: 1,449

    Hi @hnhegde ,

    For that, you'll need to do what's shown in this example. I've updated your example here.

    Cheers,

    Colin

Sign In or Register to comment.