Code Monkey home page Code Monkey logo

Comments (3)

steveush avatar steveush commented on May 29, 2024

Hi Andi,

I agree the detail row leaves much to be desired and is really just a simple data dump of the values to HTML with no real styling added to it. This however was done on purpose as we expected people to make use of the createDetail option which is really the function used to create the detail row HTML. They could then style their custom HTML as they liked with no interference from FooTable, that said I do see your point that the default detail row needs some tender love and care so I will look into making some default styles with explicit CSS classes so they can't interfere with anything that could be added later.

The below is the default createDetail function but it shows how you could override it and create pretty much whatever you like in the detail row, as you can see at the moment this is an extremely simple HTML structure with no classes applied but you could make it do whatever you like.

    $('table').footable({
      createDetail: function(element, data) {
        /// <summary>This function is used by FooTable to generate the detail view seen when expanding a collapsed row.</summary>
        /// <param name="element">This is the div that contains all the detail row information, anything could be added to it.</param>
        /// <param name="data">
        ///  This is an array of objects containing the cell information for the current row.
        ///  These objects look like the below:
        ///    obj = {
        ///      'name': String, // The name of the column
        ///      'value': Object, // The value parsed from the cell using the parsers. This could be a string, a number or whatever the parser outputs.
        ///      'display': String // This is the actual HTML from the cell, so if you have images etc you want moved this is the one to use and is the default value used.
        ///    }
        /// </param>

        for (var i = 0; i < data.length; i++) {
          element.append('<div><strong>' + data[i].name + '</strong> : ' + data[i].display + '</div>');
        }
      }
    });

Thanks
Steve

EDIT:

Just wanted to add that this is the reason for the explicit selectors and CSS classes in FooTable, as much as possible is now directly targeted to avoid any FooTable CSS styles and JS selectors cascading down to the detail row.

from footable.

andi1984 avatar andi1984 commented on May 29, 2024

Hi Steve,

thanks for your fast reply!

I already use these customization options. Sure, customization is (more or less) necessary all the time to fit personal needs, but at least in my opinion a plugin should provide a good starting point to work with. Don't understand me wrong, footable is 👍, but if you have some 🕐 pls work on these styling issues to provide some minimal CSS which considers these problems with minimal effort possible.

I think I will provide some pull requests 😄

Thanks for your work and your feedback!

from footable.

steveush avatar steveush commented on May 29, 2024

Hey Andi,

Yes, I agree with you and will add in some default styles so it's not so eye smacking with no customization. If you provide your CSS as a starting point I could work from there and add it in. I'm currently working in the Colspan branch and will make the modifications there before moving it across to the master branch.

Thanks
Steve

from footable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.