gitana / alpaca

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
http://www.alpacajs.org
Other
1.29k stars 371 forks source link

Table pagination #486

Open jasontiw opened 7 years ago

jasontiw commented 7 years ago

Hi I´m Testing this:

but never alter de pagination after event addrow

var dtConfig8 = {
    "searching": true
};
$("#field8").alpaca({
    "data": [{
        "name": "Michael Jordan",
        "sport": "basketball",
        "number": 23
    }, {
        "name": "Pele",
        "sport": "soccer",
        "number": 10
    }, {
        "name": "Wayne Gretzky",
        "sport": "hockey",
        "number": 99
    }],
    "schema": {
        "type": "array",
        "items": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "title": "Name"
                },
                "sport": {
                    "type": "string",
                    "title": "Sport",
                    "enum": ["basketball", "baseball", "hockey", "soccer", "football"]
                },
                "number": {
                    "type": "number",
                    "title": "Number"
                }
            }
        }
    },
    "options": {
        "type": "table",
        "items": {
            "fields": {
                "name": {
                    "type": "personalname"
                },
                "sport": {
                    "type": "select",
                    "optionLabels": ["Basketball", "Baseball", "Hockey", "Soccer", "Football"]
                },
                "number": {
                    "type": "integer"
                }
            }
        },
        "datatables": dtConfig8,
        "toolbarSticky": true,
        "form": {
            "buttons": {
                "addRow": {
                    "title": "Add Row",
                    "click": function() {
                        var value = this.getValue();
                        value.push({
                            "name": "New Athlete",
                            "sport": "basketball",
                            "number": 99
                        });
                        this.setValue(value);
                    }
                },
                "removeRow": {
                    "title": "Remove Row",
                    "click": function() {
                        var value = this.getValue();
                        if (value.length > 0) {
                            value.pop();
                            this.setValue(value);
                        }
                    }
                },
                "submit": {
                    "title": "Show JSON",
                    "click": function() {
                        alert(JSON.stringify(this.getValue(), null, "  "));
                    }
                }
            }
        }
    }
});

this is the result. ever showing 1 to 3 of 3 entries and also de pagination no change.

image

Thanks or your help.

jinjamator commented 2 years ago

Same here, did you ever find a solution?