spiral / toolkit Goto Github PK
View Code? Open in Web Editor NEWDynamic forms and Grids toolkit
License: MIT License
Dynamic forms and Grids toolkit
License: MIT License
Now when you return something like {status:200,message:...} the only thing you will see is
[object Object]
We have to come up with some sort of dependencies management for zero configurated frontend.
Some thoughts:
<require:script module=«spiral.core» href=«fallback path»/>
<require:script href=«compiled.js» includes=«spiral.*,project.*»/>
After all we need to have ability to bundle frontend with tools like gulp or webpack.
lets pretend we have next grid row columns:
{
"name": "name",
"fullName": "full name",
}
And I want to use a sorting here:
right now, sort name and column name are tied together:
<grid:cell.text name="fullName" label="[[Name]]" sort="true" body="{fullName}" sort-dir="asc" sort-default="true"/>
body? what for?
What I propose is to explicitly and separately define column and sorter name:
<grid:cell.text name="fullName" label="[[Name]]" sort="name" sort-dir="asc" sort-default="true"/>
Meaning render
fullName
column and apply a sorter namedname
Steps to reproduce:
1 Submit a form with empty required field
2 Field is highlighted with red color
3 Start typing anything
4 Field stays in red
Expected: Field red highlight should be removed after field value is changed
Now we have some strange example about selectable grid records - with grid description via big js array.
It is not comfortable to work with it in normal projects.
It will be more comfortable to have some options in GridSchema and use it on js-side.
As an example it can be smth like:
class SomeGrid extends GridSchema
{
public function __construct() {
$this->setOptions(
[
'selectable' => [
'type' => 'multi', // can be some const from toolkit
'id' => 'id',
]
]
);
...
As I can see from toolkit code js already works with grid option:
if (this.options.selectable) ...
Additionally it should be described in doc with more adequate example
Often there's a situation when we need to highlight more than just an input when an error occurred.
Now red highlight is applied only to label.item-form.error css style. So to emulate such behavior we need to do something like this:
<label data-message-placeholder="custom-message-placeholder" class="item-form">
<span class="item-label">[[Text emulating label text]]</span>
<form:radio name="some-name-1" value="some-value-1"/>
<form:radio name="some-name-2" value="some-value-2"/>
<form:radio name="some-name-3" value="some-value-3"/>
</label>
Expected like this:
<form:error placeholder="custom-message-placeholder">
<span class="item-label">[[Text emulating label text]]</span>
<form:radio name="some-name-1" value="some-value-1"/>
<form:radio name="some-name-2" value="some-value-2"/>
<form:radio name="some-name-3" value="some-value-3"/>
</form:error>
form:input in foreach generates the same ID (as for 1st elem)
Could you add ability to add attribute size
for select
input as it was made for textarea here.
Sometimes it is very useful to have ability to define select size
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.