About autofill and background color

About autofill and background color

jpavanjpavan Posts: 38Questions: 12Answers: 0

Topic 1 Autofill. When filling columns by dragging the value of a cell, the data is copied but not updated in the database.
Ex: It can be seen in:

https://www.pavanconsultores.com.ar/pruebas/pru01.php

where you try to copy the value of the cell in the row with ID 8, column SEM 07 down.
 
Topic 2: Background color Cells are colored according to a conditional, but when copying data by dragging, the color is refreshed only in those cells with NULL values, if the cell has some other value the color is not modified according to the new data.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 9,532Questions: 0Answers: 1,577

    Topic 1: see this example here. Look at the config for autofill, you'll see you need to reference Editor.

    Topic 2: I dragged a few 0s, and the they were colour red. I'm not seeing any background colour changes for any cells, only foreground.

    Colin

  • jpavanjpavan Posts: 38Questions: 12Answers: 0

    Topic 1: If I enter the reference to the EDITOR:

    autoFill: {
    columns: ': not (: first-child)',
    editor: editor,
    },

    the values ​​are no longer copied to the new cells, and therefore, they are not saved in the DB either. (see https://www.pavanconsultores.com.ar/pruebas/pru02.php)

    Topic 2: If you drag the value 1 of the row with ID 10, SEM 06, to ID 10 and SEM 02, the values ​​are copied, but should be done in blue.

    Some help ?

  • allanallan Posts: 52,508Questions: 1Answers: 8,014 Site admin

    Could you update your page to include the autoFill.editor option please? As Colin indicates, if you want to use Editor and AutoFill together, they need to know that the other exists.

    Also are you using our PHP libraries or your own? If your own, they need to support multi-row editing for AutoFill to work.

    Allan

  • jpavanjpavan Posts: 38Questions: 12Answers: 0

    Thanks Allan.

    Topic 1: an obvious detail was missing: indicate the primary key of the table
    rowId: 'flow_v1.flw_codflw',
    autoFill: {
    columns: ':not(:first-child)',
    editor: editor
    },
    And now it works correctly,

    Topic 2: in https://www.pavanconsultores.com.ar/pruebas/pru01.php if I change a null or a 1 to a 0 the color changes to red but changing from 0 to 1 does not change to blue

    Regards,
    jorge.

  • allanallan Posts: 52,508Questions: 1Answers: 8,014 Site admin
    edited March 8 Answer ✓

    2) You've got competing styles:

    dt-head-center highlightred highlightblue
    

    You need to add .removeClass('hihlightred') before adding the blue. And likewise remove the blue before adding the red.

    Allan

  • jpavanjpavan Posts: 38Questions: 12Answers: 0

    Thanks Allan.

    Best regards,
    jorge.

Sign In or Register to comment.