Need a data entry only screen - no edit

Need a data entry only screen - no edit

rbyrnsrbyrns Posts: 36Questions: 9Answers: 0

I was wondering if there is a way that I can catch the fact that there is only one record set remaining in a search. On that event, I would like to have editor automatically create a new record using the input of the search - and prepopulate some of the other inputs as well. Of course I would also need to have the search cleared to prepare for the next entry.
Is there a better way?

This question has an accepted answers - jump to answer

Answers

  • neilrao42neilrao42 Posts: 14Questions: 2Answers: 1

    You can listen to the length event and see how many records are visible after the page length changes. There's also a property called "recordsDisplay" in page.info() which may help you.

  • rbyrnsrbyrns Posts: 36Questions: 9Answers: 0

    Interesting, I will try examining that. I think length will get me started. It might be a sub form that will need to be called. I haven't seen a multi page form example. Is that possible?

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    I would suggest listening for draw rather than length actually. length will only change when the requested page length changes.

    I haven't seen a multi page form example. Is that possible?

    This one?

    Allan

  • neilrao42neilrao42 Posts: 14Questions: 2Answers: 1

    I would suggest listening for draw rather than length actually. length will only change when the requested page length changes.

    Interesting, length refers to the number of pages instead of the number of rows in a page?

  • rbyrnsrbyrns Posts: 36Questions: 9Answers: 0

    basically I am just needing a way to let the user put in a serial number from one database and then populate the form with data from the same database but then save it in a new database. I may be over complicating it.

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Interesting, length refers to the number of pages instead of the number of rows in a page?

    Indirectly. It refers to the number of rows requested for a page. If there aren't that many rows, then the length doesn't change. For example, consider a display length of 25 and a table with 15 records in it. Delete a row so only 14 are shown. The "display length" doesn't change, it is still 25, so length isn't triggered, but the number of records displayed is changed.

    basically I am just needing a way to let the user put in a serial number from one database and then populate the form with data from the same database but then save it in a new database

    I would use ajax.data for the target table to submit the selected serial number and redraw with the server doing the filtering (there are lots of other ways of doing it, but that's the simplest).

    Allan

  • neilrao42neilrao42 Posts: 14Questions: 2Answers: 1

    Indirectly. It refers to the number of rows requested for a page. If there aren't that many rows, then the length doesn't change. For example, consider a display length of 25 and a table with 15 records in it. Delete a row so only 14 are shown. The "display length" doesn't change, it is still 25, so length isn't triggered, but the number of records displayed is changed.

    Oh I see, good to know. :-)

This discussion has been closed.