I wanna create a wijmogrid with a column which header is free.
Tried blank, empty and & nbsp;, but nothing works.
Any ideas? Thanx in advanced.
In order to display null value or blank in column headers of WijGrid, you need to set the ‘headerText’ property of each individual column to an empty string.
Here is the code snippet:
columns: [
{ headerText: "" },
{ headerText: "" },
{ headerText: "" },
{ headerText: "" },
],
For complete implementation, please refer to the following link for sample application:
http://supportftp.componentone.com/WijGrid_BlankColumnHeaders.html
Regards
Related
I'm fairly new to WordPress and using both the ACF plugin and the REST API for the first time. I've created a custom post type with custom fields, one of which is a file field. I have the REST API enabled for the post type and am able to retrieve data, but the file field only includes the file ID. Is there any way to get the file URL without having to make an additional call for each post of that type?
The return value for that custom field is currently set to file array, although I also tried file URL, but that doesn't appear to impact the REST API.
An example of the formatted JSON returned for a test post:
[
{
"id":282,
"date":"2022-08-10T16:52:58",
"date_gmt":"2022-08-10T16:52:58",
"guid":{
"rendered":"https:\/\/[domain]\/?post_type=resourcelibrary_file&p=282"
},
"modified":"2022-08-10T16:52:58",
"modified_gmt":"2022-08-10T16:52:58",
"slug":"auto-draft",
"status":"publish",
"type":"resourcelibrary_file",
"link":"https:\/\/[domain]\/resourcelibrary_file\/auto-draft\/",
"template":"",
"meta":[
],
"vl_bok_primary_cat":[
],
"vl_cat":[
],
"acf":{
"title":"PR Test",
"author":"Test Person",
"year":2022,
"keywords":"test keyword list",
"category":[
21
],
"bok_cats":[
22,
40
],
"file":283
},
"_links":{
"self":[
{
"href":"https:\/\/[domain]\/wp-json\/wp\/v2\/resource_library_files\/282"
}
],
"collection":[
{
"href":"https:\/\/[domain]\/wp-json\/wp\/v2\/resource_library_files"
}
],
"about":[
{
"href":"https:\/\/[domain]\/wp-json\/wp\/v2\/types\/resourcelibrary_file"
}
],
"acf:term":[
{
"embeddable":true,
"taxonomy":"vl_bok_primary_cat",
"href":"https:\/\/[domain]\/wp-json\/wp\/v2\/vl_bok_primary_cat\/40"
},
{
"embeddable":true,
"taxonomy":"vl_bok_primary_cat",
"href":"https:\/\/[domain]\/wp-json\/wp\/v2\/vl_bok_primary_cat\/22"
},
{
"embeddable":true,
"taxonomy":"vl_cat",
"href":"https:\/\/[domain]\/wp-json\/wp\/v2\/vl_cat\/21"
}
],
"wp:attachment":[
{
"href":"https:\/\/[domain]\/wp-json\/wp\/v2\/media?parent=282"
}
],
"wp:term":[
{
"taxonomy":"vl_bok_primary_cat",
"embeddable":true,
"href":"https:\/\/[domain]\/wp-json\/wp\/v2\/vl_bok_primary_cat?post=282"
},
{
"taxonomy":"vl_cat",
"embeddable":true,
"href":"https:\/\/[domain]\/wp-json\/wp\/v2\/vl_cat?post=282"
}
],
"curies":[
{
"name":"wp",
"href":"https:\/\/api.w.org\/{rel}",
"templated":true
}
]
}
}
]
Thank you!
I was able to find an answer in this post: https://support.advancedcustomfields.com/forums/topic/acf-rest-api-image-only-shows-attachment-id/
Adding ?acf_format=standard to the end of my request did the trick, and that added an additional array of info beyond the ID for each file that included the URL.
I've started building a form in react-jsonschema-form and i'm having a lot of difficulty changing it visually.
The form is an array and it has a button to add and remove a set of input boxes.
I've build it as a component in a test project which has no css applied to it so far.
The form will render as a tiny box where there is no room for the buttons (they are cut of as shown below in images).
a single element
a second element
How its supposed to look on react-jsonschema-form playground
A key difference between my array and the sample array is that i'm having two text input elements per array element. I dont know if this could cause it.
I do need to have two input values as its a group of data that is related, and both is required.
This is my code:
//json schema
const schema = {
type: "object",
properties: {
listOfNumbers: {
title: "opret ledig nummerserie",
type: "array",
required: ["nr_fra", "nr_til"],
items: {
properties: {
nr_fra: {
type: "string",
pattern: "^\\d*$",
minLength: 8,
maxLength: 8,
},
nr_til: {
type: "string",
pattern: "^\\d*$",
minLength: 8,
maxLength: 8,
},
},
},
},
},
};
//uiSchema
const uiSchema = {
listOfNumbers: {
"ui:options": {
orderable: false,
},
items: {
//nr_fra: { "ui:options": { label: false } },
//nr_til: { "ui:options": { label: false } },
},
},
}
I'm applying no css to the below form.
// Form
<Form
schema={schema}
uiSchema={uiSchema}
formData={this.state.formData}
onSubmit={(formOutput) => this.handleSubmit(formOutput)}
transformErrors={transformErrors}
/>
I've spent a day and a half on trying to strongarm this, but i could really use some help on how to proceed.
It seems it was css inputs that was needed to solve this.
The below will expand the elements to their proper size/form.
Posting this here for posterity, as this is not accurately documented.
<div className="col-md-offset-3 col-md-6">
<Form schema={schema}
uiSchema={uiSchema}>
</Form>
</div>
I am trying to categorize by the failed test result in various categories using the categories.json file. I am using following JSON file:
[
{
"name": "Ignored tests",
"matchedStatuses": ["skipped"]
},
{
"name": "Infrastructure problems",
"matchedStatuses": ["broken", "failed"],
"messageRegex": ".*An unknown server-side error occurred.*"
},
{
"name": "Outdated tests",
"matchedStatuses": ["broken"],
"traceRegex": ".*FileNotFoundException.*"
},
{
"name": "Test defects",
"matchedStatuses":[
"broken",
"Element is not currently visible and may not be manipulated"
],
"traceRegex":[
".*Cannot read property.*",
".*is not in DOM or there is no element.*",
".*is not a function.*"
]
},
{
"name": "Element Not visible",
"traceRegex":[
".*still not visible after.*",
".*Element is not currently visible and may not be manipulated.*",
".*was not found by text|CSS|XPath.*"
]
},
{
"name":"Promise Rejected",
"traceRegex": [".*Promise was rejected with the following reason.*"]
}
]
and in the allure report and getting only Product Defects.
This is how it looks
I am using
allure: 2.8.1
codeceptjs: 1.4.6
appium: 1.8.2
You have wrong categories.json file format (traceRegex expected to be a string). If you want to have multiply matchers per category, simply use the same name:
[{
"name": "Element Not visible",
"traceRegex": ".*still not visible after.*"
}, {
"name": "Element Not visible",
"traceRegex": ".*Element is not currently visible and may not be manipulated.*"
}]
In addition to Dmitry Baev's answer you can always use "|" - Regex Alternation Operator (| or |)
In your case it would look as follows:
{
"name": "Element Not visible",
"traceRegex": "(.*still not visible after.*)|(.*Element is not currently visible and may not be manipulated.*)|(.*was not found by text|CSS|XPath.*)"
}
which can be further simplified to:
{
"name": "Element Not visible",
"traceRegex": ".*(still not visible after)|(Element is not currently visible and may not be manipulated)|(was not found by text|CSS|XPath).*"
}
Basically I want to this: In Mustache templating is there an elegant way of expressing a comma separated list without the trailing comma? in a Ractive template.
For the object
{
"items": [
{"name": "red"},
{"name": "green"},
{"name": "blue"}
]
}
I want to produce "red, green, blue"
I want to know if I am at the last item, so I can know whether to print the separator. Something like:
{{#items:i}}{{name}} {{#i.is_last}},{{/i}}{{/items}}
Can't easily test this right now, but wouldn't something like the following work?
{{#items:i}}
{{name}} {{ i < (items.length-1) ? "," : "" }}
{{/items}}
Can confirm that Stephen Thomas' answer works. Another option would be to join the array items like so:
ractive = new Ractive({
el: 'body',
template: '{{ items.map( getName ).join( ", " ) }}',
data: {
items: [{ name: 'red' }, { name: 'green' }, { name: 'blue' }],
getName: function ( item ) {
return item.name;
}
}
});
I actually wanted a solution that would allow me to put something more complicated instead of a comma, say, a DOM element. I figured out (another) method that works.
{{#items:i}}
{{name}}{{#(i<(items.length-1))}}, {{/end}}
{{/items}}
Recently #index and #last magic variables are introduced, so the example now becomes more readable:
{{#items}}
{{.name}}{{##index !== #last}}, {{/}}
{{/}}
I'm using codeingniter, doctrine and KendoUI on a project and I've come across this problem:
in my DB I have 2 columns of a DB but I want to show them in only one column in the KendoUI grid, so far I've been able to show them, but when I try to create a new row or edit an existing one I can't because the in the template I created I don't know how to specify the fields so I can edit and create rows, I pasted a chunk of the code and if you see in the 4th column is the problem that I have.
Thanks in advance.
schema: {
model: {
id: "idAction",
fields: {
actionId: { editable: false },
strategy: {field:"strategy", type:"number"},
actionName: { validation: { required: true } },
actionDescription: { validation: { required: true }, type:"string" },
actionEstimatedTimeQuantity: {validation: {required:true}, type:"number"},
actionEstimatedTimeUnit: {validation:{required:true}},
actionEstimatedCost:{validation:{required:true},type:"number"},
actionCreatedBy: { editable:false },
actionCreatedDate: { editable:false, type:"date" }
}
}
}
And in my columns I have
columns: [
{
field: "strategy",
width: "180px",
title: "Estrategia a usar",
values: strategies
},
{
field: "actionName",
width: "100px",
title: "Accion"
},
{
field: "actionDescription",
width: "200px",
title: "Descripción"
},
{
field: "actionEstimatedTimeQuantity - actionEstimatedTimeUnit"
template: "#= actionEstimatedTimeQuantity # - #= actionEstimatedTimeUnit #",
width: "150px",
title: "Tiempo Estimado"
},
{
field: "actionEstimatedCost",
width: "150px",
title: "Costo Estimado"
},
{
field: "actionCreatedBy",
width: "100px",
title: "Creada Por"
},
{
field: "actionCreatedDate",
width: "150px",
title: "Fecha de Creación",
format: "{0:MM/dd/yyyy}"
},
Try making a new object 'model' that represents your target data. Populate it and parse it in a controller using whatever logic you specify. Map this new model to your grid.
My team does this for every data element, essentially turning them into business objects, even if it is a direct 1 to 1 relationship.
I think you want to display two Numeric columns as a string combination "TimeQuantitiy - TimeUnit". In this case, better you add one more field of type string to the datasource of your kendo grid.
from Server: send one more column of type string "a-b"
at client: display it in grid.
Editing: You have two choices -
Use one textbox which accepts input string as "a-b"
Use two textboxes seperated with "-" (you might need to define a custom editor for you column in this case"
I would like to apologize for being more theoretical, I would try to upload some programming if possible.