jQuery addRow does not work with ebase table.

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

jQuery addRow does not work with ebase table.

#1

Postby xren » Fri Oct 25, 2013 2:29 pm

Hi Wai and Jon,

As my previous question: I have a table med table from db and is part of a form. And I need to have autocomplete work on med name column, when user input, then autcomplete promot medication list let user to pick.

As you already know, the autocomplete only work on the existing rows. If I want to add new rows and use the ebase script of insertrow and newly added row's med name column does not work with autcomplete

Then I use jquery addRow, the rows added without calling serverside ebase script, then the autocomplete works fine on the newly added rows. (not perfectly yet but it works)

However, these newly added rows by addRow in javascirpt are not recognized by the ebase server side script. after I click save, the scirpt for save action cannot get the newly added row.

I don't know what to do now.

Can you help on this?

I can send you my code if needed.

Thank you.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Mon Oct 28, 2013 8:26 am

Xiaoli,

I don't think you will be able to add table rows using jQuery successfully - the Ebase server does not know about these rows, so I don't see that it will work.

Code: Select all

As you already know, the autocomplete only work on the existing rows.
This is not correct, it should work fine. Going back through your earlier logs on this subject, I think that what is wrong is that you are using the document.ready() method to add your jQuery code - and this only runs once, when the page is initially loaded. Instead you should use a ready() method on one of the controls - I suggest the Table Control. This ensures that Ebase will add the required jQuery to new rows.

Regards
Jon
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#3

Postby xren » Mon Oct 28, 2013 2:02 pm

You are right.

I move the code to the ready function of the table control.

Everything works fine now.

Thank you very much!
Xiaoli
0 x


Who is online

Users browsing this forum: No registered users and 8 guests