node.js

node.js

wm1111wm1111 Posts: 7Questions: 1Answers: 0

in node.js,preRemove can't use return false,why?TypeError: Cannot read property 'push' of undefine

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 50,060Questions: 1Answers: 7,409 Site admin
    Answer ✓

    Thank you for letting me know about that. Fixed here and I'll have it in 1.9.1 which I'm working on.

    Allan

  • wm1111wm1111 Posts: 7Questions: 1Answers: 0

    Thank you,Allan! My question is resolved.

  • wm1111wm1111 Posts: 7Questions: 1Answers: 0

    By the way. would you got Webpage a return message,tell user can't delete row,because the row was refered.

  • allanallan Posts: 50,060Questions: 1Answers: 7,409 Site admin
    Answer ✓

    On the client-side listen for postSubmit and check the cancelled array in the JSON data. Any rows that were rejected will be listed there. You can then use error() or alert() to show a message to the user.

    Allan

  • wm1111wm1111 Posts: 7Questions: 1Answers: 0

    Thanx!
    Allan

  • wm1111wm1111 Posts: 7Questions: 1Answers: 0

    Hi,Allan!
    In Options().where(),how to use distinct or groupBy?

  • wm1111wm1111 Posts: 7Questions: 1Answers: 0

    this is my program ,but distinct not is effect
    .options(
    new Options()
    .table('capsule_pp_capsuleproduct')
    .value('id')
    .label('BatchNO')
    .where(

                  (q) => {
    
                    q.distinct('BatchNO').where('ProduceDate', '>', new Date((new Date).getTime() - 2400 * 3600 * 1000));
    
                 }
                 )
    
  • allanallan Posts: 50,060Questions: 1Answers: 7,409 Site admin

    In Options().where(),how to use distinct or groupBy?

    There is no option for either at this time. I figured that you would always want to be showing all options in the list, since each will be unique.

    If you wanted to use distinct or groupBy you could either define a VIEW with them, and then read the results from that view, or use a custom function to get the options from the database and query it directly (i.e. with Knex, giving you the full list of options it has available).

    Allan

  • wm1111wm1111 Posts: 7Questions: 1Answers: 0

    I still want to use distinct in Options,becasue my DB recorder the field not is unqiue.

Sign In or Register to comment.