Jump to content

Ajax crud loader issue?

ajax jquery div css

  • Please log in to reply
2 replies to this topic

#1 JimRustler



  • Members
  • Pip
  • 7 posts

Posted 23 November 2015 - 03:18 PM

Hello, i'm new here and i'm new using grocery crud (such amazing crud!!).


My problem is:


I'm using codeigniter, i don't like full page refreshes so i'm loading my crud table inside a div using ajax, but in the first load, buttons doesn't show correctly, it looks like this:



... but after several reloads (using F5, i'm captured the hash to request the required controller from server on document.ready), it shows correctly:



My internal code (por "parametro" controller, showed in the images) is:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Parametro extends CI_Controller {

    public function __construct(){
    public function index(){
        if(!$this->verificarUserDataSesion()) {
            header('Location: ' . base_url());
        $crud = new grocery_CRUD();
        $crud->set_subject('Parametro del Sistema');
            array('U' => 'Usuario', 'S' => 'Sistema'));
        $contenido= new stdClass();
        $data= new stdClass();
        $data->titulo= 'GestiĆ³n de Parametros del Sistema';
    private function verificarUserDataSesion(){
            return true;
            return false;

Im loading it inside a div (with buttons) with this javascript (using jquery) code:

	$("#sis-usua").click(function(e) { simple_load("usuario"); });
	$("#sis-agen").click(function(e) { simple_load("agencia"); });
	$("#sis-para").click(function(e) { simple_load("parametro"); });
	$("#par-marc").click(function(e) { simple_load("marca"); });
	$("#par-unid").click(function(e) { simple_load("unidad"); });
	$("#par-clie").click(function(e) { simple_load("cliente"); });
	$("#par-prov").click(function(e) { simple_load("proveedor"); });
	function simple_load(controller){
		.html("<center><img src=\"<?=base_url()?>img/loader-small.GIF\" style=\"margin-top:100px;\"></center>")
		.load("<?=base_url()?>" + controller);

My problem is in the first image, it's not showing correctly, i have headaches trying to figure it out, also i have some questions:

  • I can preload js and css files in header and not calling it every time i load a crud table?
  • Why new styles are not applying when i refresh (or reload) ti the crud table after i modify the original flexigrid.css file, it's an ajax issue?

Please help me and sorry if my english is bad.

#2 JimRustler



  • Members
  • Pip
  • 7 posts

Posted 25 November 2015 - 03:20 AM

Well, about the design, i loaded the flexigrid.css file in my central header, and now it works correctly. I have one more question:


hoy can i hide the filter/search bar to just show a button in the bottom left of the crud table?, i can't find it around the web.


From this:



to show like this:


#3 buoncri



  • Members
  • PipPip
  • 20 posts
  • LocationItaly

Posted 25 November 2015 - 11:13 AM

I think one way is to take the hand on the GCrud theme. Can make a copy of the actual theme and have a grid without search and then you can switch changing crud's theme.

Also tagged with one or more of these keywords: ajax, jquery, div, css

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users