Git Product home page Git Product logo

Comments (8)

cayman54 avatar cayman54 commented on May 27, 2024

hi,

I have the same question, did you get any answer?
thanks

from datatablesbundle.

fdelapena avatar fdelapena commented on May 27, 2024

I needed to do the reverse way, so I injected some dumy js code inside:

array(
    "renderif" => array("pending) == false; var dummy = function(){}; dummy("),
)

This is pretty dirty but at least it works.
You can try to play with some injected JavaScript expression as a workaround in the meanwhile.

from datatablesbundle.

cayman54 avatar cayman54 commented on May 27, 2024

I don't really understand what is in your array, can you explain it a little?

from datatablesbundle.

fdelapena avatar fdelapena commented on May 27, 2024

It just contains a value string for the row name every value of this array is passed to JavaScript, all of row name values must be true to make the button rendered.

For example, for a renderif = array("pending"):
For "pending" it will write in JS:

visibleFlag &= Boolean(row.pending);

For "pending) == false; var dummy = function(){}; dummy(" it will write in JS:

visibleFlag &= Boolean(row.pending) == false; var dummy = function(){}; dummy();

With this hack I can invert the visibleFlag condition by adding an additional condition by appending an extra == false. The dummy is just a way to open again the closed ) after the column value.

In this example the string value adds add some more stuff to the visibleFlag by adding more code inside as a JS Injection. Note this is JavaScript, so you need to deal with dataTables JS documentation if you want to try something fun there until the bundle implements something better.

from datatablesbundle.

stwe avatar stwe commented on May 27, 2024

@celvin : The activated flag is a javascript or php variable? The function wich returns true or false .... javascript or php?

from datatablesbundle.

celvin avatar celvin commented on May 27, 2024

php

Steffen [email protected] wrote:

@celvin : The activated flag is a javascript or php variable? The function wich returns true or false .... javascript or php?


Reply to this email directly or view it on GitHub:
#68 (comment)

from datatablesbundle.

stwe avatar stwe commented on May 27, 2024

Renderif should be used as follows.

            'role' => 'ROLE_USER',
            'render_if' => array(
                'id' => 1,
                'username' => 'admin',
                'enabled' => false,
                // ...
            )

from datatablesbundle.

fdelapena avatar fdelapena commented on May 27, 2024

Thank you stwe!

from datatablesbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.