⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

how to view records in twitter-bootstrap



Sangat Shah
  • profile picture
  • Member

Posted 04 November 2014 - 04:23 AM

in twitter-bootstrap  action  view (read)records is missing

how to add action in view (read)records ?is it possible  and how ?


Sangat Shah
  • profile picture
  • Member

Posted 05 November 2014 - 05:16 AM

some field can not read like dependent field 

 

i have make read.php in assets\grocery_crud\themes\twitter-bootstrap\views

 

this is read.php code :

<?php
$this->set_css($this->default_theme_path.'/twitter-bootstrap/css/bootstrap.min.css');
$this->set_css($this->default_theme_path.'/twitter-bootstrap/css/bootstrap-responsive.min.css');
$this->set_css($this->default_theme_path.'/twitter-bootstrap/css/style.css');
$this->set_css($this->default_theme_path.'/twitter-bootstrap/css/jquery-ui/flick/jquery-ui-1.9.2.custom.css');
 
$this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY);
 
// JAVASCRIPTS - JQUERY-UI
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/jquery-ui/jquery-ui-1.9.2.custom.js');
 
// JAVASCRIPTS - JQUERY LAZY-LOAD
$this->set_js_lib($this->default_javascript_path.'/common/lazyload-min.js');
 
if (!$this->is_IE7()) {
$this->set_js_lib($this->default_javascript_path.'/common/list.js');
}
// JAVASCRIPTS - TWITTER BOOTSTRAP
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/libs/bootstrap/bootstrap.min.js');
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/libs/bootstrap/application.js');
// JAVASCRIPTS - MODERNIZR
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/libs/modernizr/modernizr-2.6.1.custom.js');
// JAVASCRIPTS - TABLESORTER
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/libs/tablesorter/jquery.tablesorter.min.js');
// JAVASCRIPTS - JQUERY-COOKIE
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/cookies.js');
// JAVASCRIPTS - JQUERY-FORM
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/jquery.form.js');
// JAVASCRIPTS - JQUERY-NUMERIC
$this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.numeric.min.js');
// JAVASCRIPTS - JQUERY-PRINT-ELEMENT
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/libs/print-element/jquery.printElement.min.js');
// JAVASCRIPTS - JQUERY FANCYBOX
$this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.fancybox-1.3.4.js');
// JAVASCRIPTS - JQUERY EASING
$this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.easing-1.3.pack.js');
 
// JAVASCRIPTS - JQUERY UI
//$this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS);
//$this->load_js_jqueryui();
 
// JAVASCRIPTS - twitter-bootstrap - CONFIGURAÇÕES
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/app/twitter-bootstrap-edit.js');
// JAVASCRIPTS - JQUERY-FUNCTIONS
$this->set_js($this->default_theme_path.'/twitter-bootstrap/js/jquery.functions.js');
?>
<div class="twitter-bootstrap crud-form">
    <fieldset class="span12">
        <legend><h2> <?php echo $subject?></h2></legend>
 
    </fieldset>
<!-- CONTENT FOR ALERT MESSAGES -->
<div id="message-box" class="span12"></div>
 
<div id="main-table-box span12">
            <table class="table table-bordered table-condensed table-responsive table-striped span10">
<?php
echo form_open( $update_url, 'method="post" id="crudForm" class="form-div span12" autocomplete="off" enctype="multipart/form-data"');
foreach($fields as $field){ ?>
<div class="form-field-box" id="<?php echo $field->field_name; ?>_field_box">
                                    <tr>
                                        <th style="width: 25%">
                                            <div class="form-display-as-box" id="<?php echo $field->field_name; ?>_display_as_box">
<?php echo $input_fields[$field->field_name]->display_as?><?php echo ($input_fields[$field->field_name]->required)? '<span class="required">*</span>' : ""?> :
                                                
                                            </div>
                                        </th>
                                        <td>
                                            <div class="form-input-box" id="<?php echo $field->field_name; ?>_input_box">
                                                    <?php echo $input_fields[$field->field_name]->input?>
                                            </div>
                                        </td>
<div class="clear"></div>
                                    </tr>
</div>
<?php
}
// Hidden Elements
if(!empty($hidden_fields)){
foreach($hidden_fields as $hidden_field){
echo $hidden_field->input;
}
}?>
            <br></br>
            </table>
            <hr>
            
            <div class="span12">
<input type="button" value="<?php echo $this->l('form_cancel'); ?>" class="btn btn-large return-to-list btn-inverse" />
   </div>
 
<div class="hide loading" id="ajax-loading"><?php echo $this->l('form_update_loading'); ?></div>
 
<?php echo form_close(); ?>
</div>
</div>
<script>
var validation_url = "<?php echo $validation_url?>",
list_url = "<?php echo $list_url?>",
message_alert_edit_form = "<?php echo $this->l('alert_edit_form')?>",
message_update_error = "<?php echo $this->l('update_error')?>";
</script>

//***********************************************************************************************//

This is my CarSegment Controller  code :

 :

  $crud = new grocery_CRUD();
        
      $crud->set_table('car_segment');
      $crud->set_subject('CarSegment'); 
      $crud->set_theme('twitter-bootstrap'); 
      $crud->display_as('car_make_id','Car make');
      $crud->display_as('car_model_id','Car Model');
      $crud->display_as('car_variant_id','Car Variant');
      $crud->display_as('non_life_insurer_id','Insurer Name');
      
      
      $crud->set_relation('car_make_id', 'car_make','car_make' );
      $crud->set_relation('car_model_id', 'car_model','car_model');
      $crud->set_relation('car_variant_id', 'car_variant','car_variant');
      
      $crud->set_relation('non_life_insurer_id', 'non_life_insurer','insurer_name');
       $crud->field_type('car_segment','dropdown',array('Small' => 'Small', 'Compact' => 'Compact','Mid' => 'Mid' , 'MUV' => 'MUV','SUV'=>'SUV','HighEndVehicles'=>'HighEndVehicles'));
       $this->load->library('gc_dependent_select');
        // settings
 
        $fields = array(
 
        // first field:
        'car_make_id' => array( // first dropdown name
        'table_name' => 'car_make', // table of country
        'title' => 'car_make', // country title
        'relate' => null // the first dropdown hasn't a relation
        ),
        // second field
        'car_model_id' => array( // second dropdown name
        'table_name' => 'car_model', // table of state
        'title' => 'car_model', // state title
        'id_field' => 'car_model_id', // table of state: primary key
        'relate' => 'car_make_id', // table of state:
        'data-placeholder' => 'select model' //dropdown's data-placeholder:
 
        ),
             // second field
        'car_variant_id' => array( // second dropdown name
        'table_name' => 'car_variant', // table of state
        'title' => 'car_variant', // state title
        'id_field' => 'car_variant_id', // table of state: primary key
        'relate' => 'car_model_id', // table of state:
        'data-placeholder' => 'select model' //dropdown's data-placeholder:
 
        ),
        
 
        );
 
        $config = array(
        'main_table' => 'car_segment',
        'main_table_primary' => 'car_segment_id',
        //"url" => base_url() . __CLASS__ . '/' . __FUNCTION__ . '/', path to method
        "url" => base_url() .'index.php/PrivateCar/'. __CLASS__ . '/' . __FUNCTION__ . '/' ,
        'ajax_loader' => base_url() . 'ajax-loader.gif' // path to ajax-loader image. It's an optional parameter
 
        );
        $categories = new gc_dependent_select($crud, $fields, $config);
 
        // first method:
        //$output = $categories->render();
 
        // the second method:
        $js = $categories->get_js();
        $output = $crud->render();
        $output->output.= $js;
        $this->_example_output($output);
      

 

 

 

//***********************************************************************************************//

i have attach 

1: my database 

2:list of 

3:read