Comments (10)
set draggable:false in the array form definition
from jsonform.
Thanks that resolves the dragging issue. The height parameter for the Ace editor doesn't seem to take effect in this case though. For example, using the following the height is ignored and falls back to the default:
myAceField: { title: "My Ace Field", type: "ace", aceMode: "javascript", height: "80px" }
from jsonform.
well, 80px for a custom font, mukti-line text editor .....
maybe Ace has a minimum size
did u try using css to style it?
see https://ourcodeworld.com/articles/read/1642/how-to-change-the-line-height-in-ace-editor
from jsonform.
The height: "80px" parameter works fine if added within the form
section of the definition, it's just not recognized if added within the schema
portion of the definition. Is this only supported within the form
section?
from jsonform.
yes config of the elements is done in the form section
from jsonform.
Ok thanks. In that case is there a way to set ace as the type for an object's property within the form
section? I haven't noticed a way to do this within the documentation and was wondering if this is supported.
from jsonform.
its not the object type.. that is string (input/output for editor)
aceMode says what kind of syntax assist to use
i add
type: "ace",
aceMode: "json",
aceTheme: "twilight",
width: "100%",
height: "100px"
its right there in playground
https://jsonform.github.io/jsonform/playground/index.html?example=fields-ace
and in the doc
https://github.com/jsonform/jsonform/wiki#fields-ace
{
"schema": {
"code": {
"type": "string",
"title": "Some JSON"
}
},
"form": [
{
"key": "code",
"type": "ace",
"aceMode": "json",
"aceTheme": "twilight",
"width": "100%",
"height": "200px"
}
]
}
here we have a single schema element, code, which is a string type , and its form field title set in the schema section,
or could be set in the form section
remember 'key': connects the form element to the schema element
then we have to form section which contains one field, linked by 'key'..
then other attributes, to use in the form execution,,, exactly like adding draggable:false
this says, instead of the 'string' editor (input field), use the ace type, which is the full editor, .. the output is presented in the schema field on submit
from jsonform.
Ok thanks. And sorry if I've missed this somewhere, but what I'm trying to understand though is how to set the property of a field of type object
to the ace type. Please see the following example, I'm not clear on how to set the object
field property setStatus.statusExpression to the ace field type within the form section:
schema: { setStatus: { type: "object", properties: { menuTitle: { title: "Menu Title", type: "string" }, statusExpression: { title: "Status Expression", type: "string" } } } }, form: [ { title: "Actions", type: "array", items: [ { type: "selectfieldset", title: "Action Type", items: [ { key: "setStatus", legend: "Set Status" } ] } ] }, { type: "submit", title: "Save" } ]
from jsonform.
given your example, (as json, needs to be json)
{"schema":{
"setStatus":
{
"type":"object",
"properties":
{"menuTitle":
{
"title":"MenuTitle",
"type":"string"
},
"statusExpression":
{
"title":"StatusExpression",
"type":"string"
}
}
}
},
"form":
[
{"title":"Actions",
"type":"array",
"items":
[
{
"type":"selectfieldset",
"title":"ActionType",
"items":
[
{
"key":"setStatus.statusExpression",
"title":"SetStatus1",
"type":"ace"
}
]
}
]
},
{
"type":"submit",
"title":"Save"
}
]
}
using playground to test the form definition, copy/paste to the playground window
from jsonform.
That works: thanks! cheers
from jsonform.
Related Issues (20)
- Add custom field to fieldset HOT 2
- activeClass isn't applied correctly for schemas with defaults HOT 2
- How to build a stepper form HOT 4
- process change, just fyi.. all PRs against develop branch
- Expanded Fieldset + Default TabIndex set - Collapse issue (bug) HOT 4
- tabs-left not supported in bootstrap v3
- Hide submit button HOT 2
- How to escape slash in scope HOT 3
- Rendering fails if property name contains dots HOT 1
- Missing array brackets [] on array items when using a custom field type HOT 1
- Error: JSONForm does not yet support schemas that use the $ref keyword. See: #54" HOT 2
- Boolean options are always true HOT 5
- How to use this library with bundler HOT 1
- How to show error after a control value is changed, HOT 1
- date / datetime formatting HOT 3
- Advancedfieldset form folding click handle gets duplicated when jsonform gets called again causing the folded form to flick HOT 6
- Textarea Rows HOT 2
- Fieldset along with the Select all checkbox. HOT 7
- Array binding issue HOT 7
- Swapping the images HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonform.