ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Flexigrid - Lightweight but rich data grid

March 28, 2008 10:13am

Subscribe [82]
  • #661 / Feb 11, 2010 3:37am

    Thien

    1 posts

    addCellProp: function() {

    var pthArray = $('th', g.hDiv);
    var columns = pthArray.length;
    var cellNum = 0;

    $('tbody tr td', g.bDiv).each(function() {
    var n = cellNum % columns;
    var pth = pthArray[n];
    cellNum++;

    var tdDiv = "<div [removed]abbr') && p.sortname) {
    this.className = 'sorted';
    }
                    tdDiv += $(‘div:first’, pth).attr(“style”);

                    if (pth.hide) $(this).css(‘display’, ‘none’);
                  }

                  if (p.nowrap == false) tdDiv += “white-space:normal;”;

                  if (this[removed] == ‘’) this[removed] = ‘ ’;

                  tdDiv += “‘>” + this[removed] + “</div>”;

                  if (pth != null) {
    var prnt = $(this).parent()[0];
    var pid = false;
    if (prnt.id) pid = prnt.id.substr(3);
    if (pth.process) pth.process(tdDiv, pid);
    }

                  this[removed] = tdDiv;
              });

    Hi Guy

    i try to use your source but it has error at this[removed] = tdDiv;. so what is “removed”

  • #662 / Mar 15, 2010 9:03am

    Hi
    Has anyone tried to implement multiple column search in fliexigrid?

  • #663 / Mar 19, 2010 8:02am

    jikowhitewolf

    8 posts

    How do I read the contents from this table “items”?

    $items         = rtrim($_POST['items'],",");

    I really need some help on how I can insert multiple selection, the same way how the delete.php works on delete multiple selection.

    http://ellislab.com/forums/viewthread/148425/

    Help pls.

  • #664 / Apr 11, 2010 7:36am

    sujimohan

    2 posts

    Hi,

    I have a problem in the flexigrid. Instead of button in actions i used href link with text. But on click on the any row is hiding or making the href text to disappear. on Unselecting the row, its visible again. Can anyone help me please

  • #665 / Jun 15, 2010 1:31pm

    - Obonk -

    10 posts

    guys any one here have implement more than 1 flexigrid on 1 page? please tell me how… 😜

  • #666 / Jun 18, 2010 9:52pm

    coventryDigital

    1 posts

    Hello,
    I am implementing FlexiGrid with CI in an admin tool and have two columns in the database that I would like to concatenate into one column in a flexigrid.  I’ve successfully created a query to merge the two columns into the grid.  However, now the column is not sortable and is not search-able.  I would really appreciate if someone could point me in the direction of how to do this.

    Thanks in advance…

  • #667 / Jun 19, 2010 6:26am

    - Obonk -

    10 posts

    Guys how to baypass variable from the form so the variable can send to the ajax controller for making the WHERE clause Variable on the model. please help !!!

  • #668 / Jun 28, 2010 7:07am

    Hi
    Has anyone tried to implement multiple column search in fliexigrid?

    I’ve created some new feature for multiple column searching, but, it’s still in development..

    here’s the code

  • #669 / Jul 13, 2010 6:53pm

    khyqo

    6 posts

    good day everyone.. i tried to connect it with my database but to no result was returned.. anyone who could guide me in setting it up?

    i am got the code here >> http://sanderkorvemaker.nl/test/flexigrid

    thanks in advance..

  • #670 / Aug 09, 2010 2:03pm

    ac1982

    1 posts

    Is it possible to make the rows clickable so that I can attach an action to the row? (Ferinstance, click a name, run an ajax call to bring up data in another div)

    Yes you can, see below:

    1. Add this variable to the line 19 p = $.extend({ ondbclick: null,

    2. Add .dblclick event as shown below

    //line 724
    $('tbody tr',g.bDiv).each
    (
        function ()
        {
            $(this)
            .click(
                function (e) 
                { 
                    var obj = (e.target || e.srcElement); 
                                    if (obj.href || obj.type) return true;
                                         $(this).toggleClass('trSelected');                                        
                    if (p.singleSelect) $(this).siblings().removeClass('trSelected');
                }
            )
    
    //below .click add this line        
    .dblclick(
        
    function (e)                                 {                                             
        if(typeof p.ondbclick == 'function'){
            p.ondbclick($(this).attr('id').substr(3));
        }
    })

     

    3. In flexigrid configuration add the name of you method to ondbclick

    $("#flex1").flexigrid
    (
        {
            url: 'post2.php',
            dataType: 'json',
            title: 'Countries',
            pagetext: 'Page',
            pagestat: 'Showing {from} to {to} of {total} items',
            outof: 'of',
            findtext: 'Find',
            procmsg: 'Processing, please wait ...',
            colModel : [
                {display: 'ISO', name : 'iso', width : 40, sortable : true, align: 'center'},
                {display: 'Name', name : 'name', width : 180, sortable : true, align: 'left'},
                {display: 'Printable Name', name : 'printable_name', width : 120, sortable : true, align: 'left'},
                {display: 'ISO3', name : 'iso3', width : 130, sortable : true, align: 'left', hide: false},
                {display: 'Number Code', name : 'numcode', width : 80, sortable : true, align: 'right'}
            ],
            buttons : [
                {name: 'Add', bclass: 'add', onpress : test},
                {name: 'Delete', bclass: 'delete', onpress : test},
                {separator: true}
            ],
            searchitems : [
                {display: 'ISO', name : 'iso'},
                {display: 'Name', name : 'name', isdefault: true}
            ],
            sortname: "iso",
            sortorder: "asc",
            usepager: true,        
            useRp: true,
            rp: 15,
            showTableToggleBtn: true,
            width: 700,
            height: 200,
            ondbclick: editMe
        }
    );

    4. create the method that you need to make a call

    function editMe(id){
        alert(id);
    }
  • #671 / Feb 08, 2011 6:28am

    zend

    32 posts

    how to load two tables from the database and merge them?
    I have two tables Users and Groups I want to show customers and to show what group they belong to the Administrator or Normal User

    function JOIN is not work in fg

  • #672 / Feb 08, 2011 7:41am

    Basketcasesoftware

    442 posts

    That’s because Flexigrid handles it’s own database queries. It doesn’t bother with models. At least that’s what I make out from reading what little documentation that is there. It breaks the MVC pattern.

  • #673 / Feb 16, 2011 3:15am

    indrajit_l

    3 posts

    this is not working in CI 2.0, can u pls post an example for CI 2.0

    thanks

  • #674 / Feb 16, 2011 3:55am

    Basketcasesoftware

    442 posts

    Please see my reply in the other Flexigrid thread you posted this question in.

  • #675 / Feb 22, 2011 10:13am

    german.zvonchuk

    8 posts

    Hello, codeigniter developers.
    I have a problem with Flexigrid. I have a table with some fields which feeds flexigrid. When I run the below code, I get some fields under the flexigrid table to search by fields. When I select client_fullname, it tries to search client_fullname field on the selected table but there is no such field. I know I can do it using subquery but I don’t know how to do it with active records.

    SELECT
      CONCAT(IFNULL(client_name, ""), " ", IFNULL(CONCAT(SUBSTRING(client_patronymic, 1, 1), "."), ""), " ", IFNULL(client_lastname, "")) AS client_fullname,
      DATE_FORMAT(reg_date, "%Y-%m-%d %H:%i") AS reg_date,
      DATE_FORMAT(date_issue_login, "%Y-%m-%d %H:%i") AS date_issue_login,
      login,
      agent_login
    FROM (account)
    WHERE login = '151501'
    ORDER BY reg_date DESC
    LIMIT 1

    Active Record code is below:

    SELECT
      CONCAT(IFNULL(client_name, ""), " ", IFNULL(CONCAT(SUBSTRING(client_patronymic, 1, 1), "."), ""), " ", IFNULL(client_lastname, "")) AS client_fullname,
      DATE_FORMAT(reg_date, "%Y-%m-%d %H:%i") AS reg_date,
      DATE_FORMAT(date_issue_login, "%Y-%m-%d %H:%i") AS date_issue_login,
      login,
      agent_login
    FROM (account)
    WHERE login = '151501'
    AND `client_fullname` LIKE "%Testname%"
    ORDER BY reg_date DESC
    LIMIT 1
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases