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]
  • #121 / Apr 08, 2008 5:28pm

    paulopmx

    164 posts

    Great Job Eric.

    I would have use different technique, but as long as it works for you, and that the plugin is useful for you then I’m happy about it. 😊.

    Paulo

    I am sure you would!  I just started learning Javascript on Saturday, still having trouble with the prototypal nature of the language and syntax.  I will say I have learned a ton from reading your code and stepping through it with the debugger.  Coffees on the way, to say TY.

    Eric

    ps. BAH!, still got a bug, clobbered my paging.  Lack of sleep kills.

    My mistake was to add page to params.  What is the correct way to call
    flexOptions with just one option to set, i.e. page:1 ?

    Hi Eric,

    Thanks for the coffee.

    you can set the page you want through flexOptions with this setting

    $('#flex1').flexOptions({newp:1});
  • #122 / Apr 08, 2008 7:22pm

    ecarsted

    19 posts

    Hey Paulo,

    $('#flex1').flexOptions({newp:1});

    Fixed my paging problem.

    A couple questions for you.

    1) Is it possible to set the table to only select one row?
    2) How do I add an event to a row being selected/deselected?

    I am sure it is something like you posted before for the cell edit

    function yourfunction()
    {
    $(".selectrow").click(function(){
    alert("HIT!");    
    });
    }
    function selectRowClassfunction(rowDiv)
    {
       $(rowDiv).addClass('selectrow');
    }


    Eric

  • #123 / Apr 08, 2008 9:49pm

    paulopmx

    164 posts

    Hey Paulo,

    $('#flex1').flexOptions({newp:1});

    Fixed my paging problem.

    A couple questions for you.

    1) Is it possible to set the table to only select one row?
    2) How do I add an event to a row being selected/deselected?

    I am sure it is something like you posted before for the cell edit

    function yourfunction()
    {
    $(".selectrow").click(function(){
    alert("HIT!");    
    });
    }
    function selectRowClassfunction(rowDiv)
    {
       $(rowDiv).addClass('selectrow');
    }


    Eric

    I really did not design it that way.

    It’s possible to add an event to the cell that i’m passing to the process API, and you might be able to do it that way, although you can’t stop the current behavior of the row from triggering, this can result from multiple events triggering when user clicks a row.

    But someone else has ask for this feature, and I while considering adding custom behavior API in the next release. It is still in beta anyway.

  • #124 / Apr 09, 2008 1:22pm

    wardenik

    6 posts

    hey,
    i’ve just started using flexigrid, but found it quite weird that it doesn’t work in IE7 with this type of table:

    <table class=“flexme1”>
      <thead>
            <tr>
              <th width=“100”>Col 1</th>

            </tr>
      </thead>
    </table>
    <table class=“flexme2”>
    <thead>
        <tr>
        <th>Day</th>
        </tr>
    </thead>
    </table>

            $(’.flexme1’).flexigrid();
            $(’.flexme2’).flexigrid();

     

    So, the first one works. The second does not if you don’t specify width. That’s quite weird especially when using jquery that should figure out the styling quite easily. Anyone had that problem?

  • #125 / Apr 09, 2008 3:49pm

    paulopmx

    164 posts

    hey,
    i’ve just started using flexigrid, but found it quite weird that it doesn’t work in IE7 with this type of table:

    <table class=“flexme1”>
      <thead>
            <tr>
              <th width=“100”>Col 1</th>

            </tr>
      </thead>
    </table>
    <table class=“flexme2”>
    <thead>
        <tr>
        <th>Day</th>
        </tr>
    </thead>
    </table>

            $(’.flexme1’).flexigrid();
            $(’.flexme2’).flexigrid();

     

    So, the first one works. The second does not if you don’t specify width. That’s quite weird especially when using jquery that should figure out the styling quite easily. Anyone had that problem?

    Hi Wardenik,

    Yes width is a required setting. You can see it in my example 1 and example 2. Why? Because different browsers has different way of rendering a table without width definition, specially Internet Explorer.

    You will see that although I can render Flexigrid with the zero setting, that I do require some standards, like having a thead, a tbody and width definition. This will ensure that Flexigrid renders the same table similarly among its supported browsers.

  • #126 / Apr 09, 2008 5:45pm

    wardenik

    6 posts

    Hey,

    That is cool that you do, but this is almost an inline style.
    It should not require (it can’t!) an inline width specification.
    CSS is for that and you can set all styles you want in there and CSS is to ensure it is rendered in all browsers the same.

  • #127 / Apr 09, 2008 6:58pm

    paulopmx

    164 posts

    Hey,

    That is cool that you do, but this is almost an inline style.
    It should not require (it can’t!) an inline width specification.
    CSS is for that and you can set all styles you want in there and CSS is to ensure it is rendered in all browsers the same.

    After the grid is generated you will see that the width property is removed.

  • #128 / Apr 09, 2008 7:31pm

    wardenik

    6 posts

    Hey,

    That is cool that you do, but this is almost an inline style.
    It should not require (it can’t!) an inline width specification.
    CSS is for that and you can set all styles you want in there and CSS is to ensure it is rendered in all browsers the same.

    After the grid is generated you will see that the width property is removed.

    Erm, indeed. but that is not the point 😊
    I mean, i don’t want to generate styling inside a datamodel because it is not the way it should be done and is pretty pointless.
    moreover, i can’t see any reason for adapting the width automatically.
    if the user does not like it, he has the CSS for it.

  • #129 / Apr 09, 2008 7:43pm

    paulopmx

    164 posts

    Hey,

    That is cool that you do, but this is almost an inline style.
    It should not require (it can’t!) an inline width specification.
    CSS is for that and you can set all styles you want in there and CSS is to ensure it is rendered in all browsers the same.

    After the grid is generated you will see that the width property is removed.

    Erm, indeed. but that is not the point 😊
    I mean, i don’t want to generate styling inside a datamodel because it is not the way it should be done and is pretty pointless.
    moreover, i can’t see any reason for adapting the width automatically.
    if the user does not like it, he has the CSS for it.

    Ehem. Styling is not the point also 😊. It is for configuration purposes, putting configuration for plugins in attributes is done widely and more rampant in others. If you really don’t want to use the attribute, then create a colModel, If you are really using Flexigrid for datamodel purposes. And no, creating colModel is not for the ajax purposes only, you can use it to construct your column headers.

  • #130 / Apr 09, 2008 8:06pm

    wardenik

    6 posts

    Ok then, if it is not for styling, then where is the problem of dropping the declaration and using the header model derived from the table <thead> itself? 😉

  • #131 / Apr 09, 2008 8:16pm

    paulopmx

    164 posts

    Ok then, if it is not for styling, then where is the problem of dropping the declaration and using the header model derived from the table <thead> itself? 😉

    As I explained in my previous post, I encountered differences among browsers on how they handle cells without width but with content. Allowing the user to set the width in the cell gives me an idea, on what he/she expects 😉.

  • #132 / Apr 09, 2008 8:19pm

    wardenik

    6 posts

    Ok then, if it is not for styling, then where is the problem of dropping the declaration and using the header model derived from the table <thead> itself? 😉

    As I explained in my previous post, I encountered differences among browsers on how they handle cells without width but with content. Allowing the user to set the width in the cell gives me an idea, on what he/she expects 😉.

    But you know that you deny yourself this way.
    This is *exactly* styling the output (i.e. hinting the style/layout) 😛

  • #133 / Apr 09, 2008 8:25pm

    paulopmx

    164 posts

    Ok then, if it is not for styling, then where is the problem of dropping the declaration and using the header model derived from the table <thead> itself? 😉

    As I explained in my previous post, I encountered differences among browsers on how they handle cells without width but with content. Allowing the user to set the width in the cell gives me an idea, on what he/she expects 😉.

    But you know that you deny yourself this way.
    This is *exactly* styling the output (i.e. hinting the style/layout) 😛

    Styling the output yes, but not *exactly* of the td tag itself (i.e. styling is transfered on a div inside the td), which was the basis of your concern in the first place 😛

  • #134 / Apr 09, 2008 8:30pm

    wardenik

    6 posts

    Ok then, if it is not for styling, then where is the problem of dropping the declaration and using the header model derived from the table <thead> itself? 😉

    As I explained in my previous post, I encountered differences among browsers on how they handle cells without width but with content. Allowing the user to set the width in the cell gives me an idea, on what he/she expects 😉.

    But you know that you deny yourself this way.
    This is *exactly* styling the output (i.e. hinting the style/layout) 😛

    Styling the output yes, but not *exactly* of the td tag itself (i.e. styling is transfered on a div inside the td), which was the basis of your concern in the first place 😛

    Erm, not at all.
    I am not at all afraid about styling problems.
    I just do not want ANY styling in the table model because it is simply not needed 😊
    What is done afterwards (i mean after () is run, and table is changed to divs) i don’t care 😊

  • #135 / Apr 09, 2008 8:50pm

    paulopmx

    164 posts

    Ok then, if it is not for styling, then where is the problem of dropping the declaration and using the header model derived from the table <thead> itself? 😉

    As I explained in my previous post, I encountered differences among browsers on how they handle cells without width but with content. Allowing the user to set the width in the cell gives me an idea, on what he/she expects 😉.

    But you know that you deny yourself this way.
    This is *exactly* styling the output (i.e. hinting the style/layout) 😛

    Styling the output yes, but not *exactly* of the td tag itself (i.e. styling is transfered on a div inside the td), which was the basis of your concern in the first place 😛

    Erm, not at all.
    I am not at all afraid about styling problems.
    I just do not want ANY styling in the table model because it is simply not needed 😊
    What is done afterwards (i mean after () is run, and table is changed to divs) i don’t care 😊

    Ehem, then you don’t have to, use a colModel.

    Using a colModel, only requires you to put a table with either a class or an id. The thead, tbody, tr, or td with any styling is simply won’t be needed 😊.

    What approach you take in using the plugin is really up to you. An approach is optional not required, but taking one approach does have a requirement. You want less html, then you are required to put in a little more settings through javascript, or if you want less javascript, then you are required to put in a little more attributes in your html.

    Either way people care about the outcome, and in order for the plugin to know what they want, they have to tell the plugin what they want.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases