Skip to content

Feature request: exposed flattenJSON method #4

@jtrumbull

Description

@jtrumbull

@djhvscf: I forked this repository and was going to create some PRs. Didn't want to get to far if this is something that you are working on -or did't want in the extension.

BootstrapTable.prototype.flattenJSON = function(data) {
    if (Object.prototype.toString.call(data) === "[object Object]") {
        return sd.flat(data);
    }
    return sd.flatHelper(data);
};

$.fn.bootstrapTable.methods.push('flattenJSON');

Usage:

// On Array
$('#table').bootstrapTable('flattenJSON', [
    {...},
    {...},
    {...}
]);

// or Object
$('#table').bootstrapTable('flattenJSON', {...});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions