node.js

node.js

wm1111wm1111 Posts: 15Questions: 3Answers: 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: 63,468Questions: 1Answers: 10,466 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: 15Questions: 3Answers: 0

    Thank you,Allan! My question is resolved.

  • wm1111wm1111 Posts: 15Questions: 3Answers: 0

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

  • allanallan Posts: 63,468Questions: 1Answers: 10,466 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: 15Questions: 3Answers: 0

    Thanx!
    Allan

  • wm1111wm1111 Posts: 15Questions: 3Answers: 0

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

  • wm1111wm1111 Posts: 15Questions: 3Answers: 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: 63,468Questions: 1Answers: 10,466 Site admin
    Answer ✓

    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: 15Questions: 3Answers: 0

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

  • wm1111wm1111 Posts: 15Questions: 3Answers: 0

    hi,Allan.
    I have a problem again. in bubble edit,if use leftJoin to link another table,click the linked table cell,console display error above.
    dataTables.editor.min.js:66 Uncaught Unable to automatically determine field from source. Please specify the field name. For more information, please refer to https://datatables.net/tn/11

  • allanallan Posts: 63,468Questions: 1Answers: 10,466 Site admin

    Hi,

    The page the error links to provides a detailed describe of the problem and how to resolve it. Basically the columns.data for the DataTable column and field.name for the Editor field don't match, so you need to tell DataTables which field you want to edit when that column is activated.

    Allan

  • wm1111wm1111 Posts: 15Questions: 3Answers: 0

    Thanx.Allan

  • wm1111wm1111 Posts: 15Questions: 3Answers: 0
    edited August 2019

    web page:

    editor.fields: [
                         {
                            label: "批次:",
                            name: "capsule_pp_capsuleproductsub.BatchNO",
                            type: "select",
                            placeholder: "选择批次"
    
                        },
    
    table. columns: [
                        { data: "capsule_pp_capsuleproduct.BatchNO" },
    

    server :

         editor.Field('capsule_pp_capsuleproductsub.BatchNO')
                .options(
                    new Options()
                    .table('capsule_pp_capsuleproduct')
                    .value('id')
                    .label('BatchNO')
                ),
    .leftJoin('capsule_pp_capsuleproduct', 'capsule_pp_capsuleproduct.id', '=', 'capsule_pp_capsuleproductsub.BatchNO')
    

    namly, editor have not field"capsule_pp_capsuleproduct.BatchNO",then can't use bubble edit method on the field,isn't?

    Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • wm1111wm1111 Posts: 15Questions: 3Answers: 0

    Hi,Allen
    How to only update edited field , other can't edited field not update?

  • wm1111wm1111 Posts: 15Questions: 3Answers: 0

    How to display to upload image as thumbnail in the table cell

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @wm111 ,

    Does this example here help?

    Cheers,

    Colin

  • wm1111wm1111 Posts: 15Questions: 3Answers: 0

    thanx,Colin.
    But my image is too big,display it will to occupy almost totall webpage.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @wm1111 ,

    Ah, I see. This thread here (and here) talks about how to create a thumbnail, you need to create an action to do it. Then this section of the manual explains how to display it.

    Cheers,

    Colin

This discussion has been closed.