jQuery (or any web tool) Nested Expression Builder

后端 未结 5 504
遥遥无期
遥遥无期 2020-12-24 15:19

I would like to add a feature to a web app I am developing to allow the user to create rules with an expression builder. Such as the one used in Magento (picture in link bel

相关标签:
5条回答
  • 2020-12-24 15:49

    In Mac OS X terms it is called a “predicate editor”, and can be found in Mail.app and iTunes. I had need for one a while ago, and scoured the web from end to end without finding one. I ended up building my own using jQuery, and it looks like this (text is in norwegian, sorry):

    Javascript predicat editor

    Sadly this is used in an internal project and the source code is not available as it is very application-specific. There is a need for a free component like this though, so if I get around to it I will try to clean this up and release it.

    0 讨论(0)
  • 2020-12-24 15:52

    This here should be exactly what you're looking for?

    • Demo: https://github.com/chrisjpowers/business-rules
    • Code: https://github.com/chrisjpowers/business-rules
    0 讨论(0)
  • 2020-12-24 15:52

    https://packagist.org/packages/ruler/ruler

    https://github.com/bobthecow/Ruler

    This is very similar to magento one and we are going to use it in our laravel application.more guidance for implementation you can find there.

    0 讨论(0)
  • 2020-12-24 15:58

    No mainstream tool out there for PHP... except the ones we make for ourselves :)...Its easy to implement a decent one... Just need to decide where you will store the rules... I had built one for myself with the Rule definition stored in XML ... Then updated it a few months back to store that in JSON .... You write "smarty like" templates for the output you want... 2 cases where I used this was for an Active Record implementation as well as PDF generation ... the move to JSON was because most of the newer usage scenarios were related to throwing out javascript for the pages to consume...

    0 讨论(0)
  • 2020-12-24 16:12

    This fits the bill: (jquery) predicate-builder

    0 讨论(0)
提交回复
热议问题