Skip to content

Feature request: exposed flattenJSON method #4

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', {...});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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