Support for xCRUD - Data Management System (PHP CRUD)

Support for xCRUD - Data Management System (PHP CRUD)

4.71 (554 ratings) 4.71 stars
Cart 4,731 sales

f0ska does not currently provide support for this item.

Popular questions for this item

How to use Select2 with xCRUD?

Select2 initialization code example:

jQuery(document).on("xcrudbeforerequest", function(event, container) {
    if (container) {
    } else {
jQuery(document).on("ready xcrudafterrequest", function(event, container) {
    if (container) {
    } else {
jQuery(document).on("xcrudbeforedepend", function(event, container, data) {
    jQuery(container).find('select[name="' + + '"]').select2("destroy");
jQuery(document).on("xcrudafterdepend", function(event, container, data) {
    jQuery(container).find('select[name="' + + '"]').select2();

How to make it works on ajax sites or in dynamic content?

There are two methods to make it works with ajax:

1) Write init code into your ajax callback function (after inserting ajax response data in content):


2) Add ‘xcrud’ class name to any static parent container on your page, which contains your dynamic data,but can’t be changed by ajax. For testing you can add ‘xcrud’ class name even to <body> tag, but the best if this will be closest static container from dynamically changed content.

But this is not all.
As you know, it is very bad when scripts and styles are loads via ajax. So you must put xcrud’s scripts and styles out of dynamic container. You can do it with load_css() and load_js() methods. Now, see a simple example:
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Some page title</title>
    <?php echo Xcrud::load_css(); ?>

    <div id="ajax">
        Some dynamic content here

    <?php echo Xcrud::load_js(); ?>
Do not forget to set $manual_load parameter in xcrud_config.php to true.

Is Xcrud has login / user manager ? Will you create some simple login / auth for Xcrud soon? How I can restrict access to Xcrud?

XCRUD hasn’t login functionality and will never had.
You must protect your pages with login system where you use Xcrud. You can use any login system you want.
This is CRUD library, not full admin area.
You can use it on your existing page, protected or not protected.
You can create some user management with xcrud, but not login script.
This is the same as create login for slider :) Xcrud works on your pages, like some module or plugin, it is NOT an independent application.

How to get events from Xcrud’s fields and how to do some custom actions with jQuery?

Xcrud uses ajax interface, so you must delegate your events from ”.xcrud” container.
You can add needed attribute to a field with set_attr() method.
Example: lets write sum of two fields in third field
PHP code:

$xcrud = Xcrud::get_instance();
// set custom ids to get easy selectors for js
echo $xcrud->render();

Now Javascript: you can write it in any of your javascript files or in <script> tag on your page
   // event must be delegated from .xcrud
   $(".xcrud").on("keyup","#field1,#field2",function(){ // !important, delegation from static container
      var f1 = parseFloat($("#field1").val());
      var f2 = parseFloat($("#field2").val());
      if(!isNaN(f1) && !isNaN(f2)){

How to implement autocomplete in xCRUD?

You can use any autocomplete plugin with Xcrud.
You can set needed attribute to a target field with method set_attr().
If your plugin does not support dynamic content, you must use xcrudafterrequest event to reinit plugin when content will be changed with Xcrud.
Here an example of autocomplete with jQueryUI without ajax support (jQueryUI already present in Xcrud, so you no need anything more). This will set autocomplete to all Xcrud’s text inputs:

<script type="text/javascript">
jQuery(document).on("ready xcrudafterrequest",function(){
     var availableTags = [
        source: availableTags

See more about jQueryUI Autocomplete

Show more