Smart Grid remote files generator

This script automatically builds Smart Grid remote files corresponding to your table. The remote files are used to retreive data from the table and parse queries posted by Smart Grid to add/modify data in the table.

To generate remote files for your Smart Grid instance the following steps should be performed:

  1. Take JS code of your SG and put in this file between
    /*
    
    Smart Grid Code
    
    */
    
    and
    /*
    
    !Smart Grid Code
    
    */
    

    Eg.
    /*
    
    Smart Grid Code
    
    */
    
    var smart_grid = new SmartGrid('smart_grid');
    
    var sc0 = new SmartCell_image();
    	sc0.folder = '/images';
    	sc0.preview_size = 500;
    	sc0.set_value(4);
    	sc0.params = {
    db_field: ''
    	};
    var sc0_params = {
    	'name': 'Picture',
    	'width': '50'
    };
    	smart_grid.add_column(sc0_params, sc0);
    
    
    var sc1 = new SmartCell_text();
    	sc1.params = {
    db_field: 'name'
    	};
    var sc1_params = {
    	'name': 'Name1234567890123456789',
    	'width': '140'
    };
    	sc1.readonly = true;
    	smart_grid.add_column(sc1_params, sc1);
    
    . . .
    /* Smart Grid Code */
  2. Place an object with the same ID as specified as an argument for function SmartGrid, eg:
    <div id="smart_grid" style="display:none">
    </div>
    
  3. Type name of your table in text field "Table name".
  4. Click on "Generate!" button.
  5. Save content of text areas "XML data file (xml_data.php)" and "Save SG table file (save_sg_table.php)" as files xml_data.php and save_sg_table.php correspondingly.
  6. That's all.



Table name:


XML data file template:

XML data file (xml_data.php):


Save SG table file template:

Save SG table file (save_sg_table.php):