In my Appian interface, I have a section layout and I want to have a part of the label, namely the "End of Month" be clickable:
{
a!sectionLayout(
label: "Report ""End of Month""",
contents: { [...] }
)
}
I thought of using a link component, but the following does not work (it gives me a lengthy, unreadable label):
{
a!sectionLayout(
label: {
concat("Report ",
a!linkField(
label: "",
links: a!safeLink(
label: "End of Month",
uri: "http://the-full-url-pointing.to/end_of_month"
)
)
},
contents: { [...] }
)
}
Is there a lengthy solution using a Rich Text Component inside the label of the section layout?
There is no feature available to configure a link to any component's label.
And yes, you need to use Rich Text Component as following:
{
a!richTextDisplayField(
value: {
a!richTextItem(
text: "Report ",
style: "STRONG",
size: "MEDIUM_PLUS"
),
a!richTextItem(
text: "End of Month",
style: "STRONG",
size: "MEDIUM_PLUS",
link: a!safeLink(
/*label: "End of Month",*/
uri: "http://the-full-url-pointing.to/end_of_month"
)
)
}
),
a!sectionLayout(contents: {})
}
UI Screenshot:
Also, with rich text component, you can adjust the size, color and style of the text.
I hope, this helps.
Related
I am new to the Tabulator plug-in and I am attempting to copy data from one table to another using the Tabulator copyToClipboard method but with no success.
In my application I have created eleven <div> elements (one for the [Crew Leader] and one each for up to ten [Crew Members]) to serve as containers for the Tabulator tables to be instantiated. I am hoping to copy data from the [Crew Leader] table and paste it into each of the affected [Crew Member] tables thus mitigating data re-entry. This sequence of copy/paste events is triggered by the click event bound to a <button> in the header of the [Crew Leader] table. The following function is called by the <button> click event:
function CloneTable() {
// Verify the [Crew Leader] Tabulator table is present....
var tableLeader = Tabulator.prototype.findTable("#CrewLeaderTable");
if (tableLeader.length > 0) {
alert("The Tabulator table #CrewLeaderTable was found.\ntable.length = " + tableLeader.length);
tableLeader.copyToClipboard("all");
alert("The table contents were copied to the clipboard.");
}
else {
alert("The Tabulator table #CrewLeaderTable was not found.");
}
}
The first alert message verifies that the #CrewLeaderTable object has been found as anticipated. However, the second alert verification is never received thus indicating failure of the Tabulator copyToClipboard method.
I have read through as much of the relevant Tabulator documentation as I can find and I am hoping I have simply overlooked something in my setup.
The following is a copy of my Tabulator constructor:
var table = new Tabulator(divid, {
height: "100%",
layout: "fitDataFill",
movableRows: true, //enable user movable rows
tabEndNewRow: true, //create empty new row on tab
rowContextMenu: myActionContextMenu,
keybindings: {
"navUp": true, //enable navUp keybinding using the "up arrow" key
"navDown": true, //enable navDown keybinding using the "down arrow" key
},
columns: [
{ title: "Phase Code", field: "phaseCode", width: 144, editor: "select", editorParams: { values: function (cell) { return window.laborPhaseCodes; } } },
{ title: "Date Worked", field: "dateComp", hozAlign: "center", sorter: "date", editor: dateEditor },
{ title: "Start Time", field: "timeStart", hozAlign: "center", sorter: "time", editor: timeEditor },
{ title: "Finish Time", field: "timeFinish", hozAlign: "center", sorter: "time", editor: timeEditor },
{ title: "Memo", field: "memo", width: 144, hozAlign: "left", editor: "input" },
{ title: "<button type='button' id='btnClone' class='btn btn-success btn-sm py-0' style='font-size:10px;'>Clone</button>", headerSort: false, headerClick: tabCloneTable }
],
cellEdited: function (cell) {
}
});
I have spent a couple of days trying to figure out the best way to "clone" the data from one table into another. The Tabulator documentation is fairly comprehensive but I fear I have overlooked something. Any assistance is greatly appreciated.
It looks like copyToClipboard doesn't return the data, it is maintained internally and not accessible. But, with what you are doing set/getData works fine.
Here is an example, https://jsfiddle.net/nrayburn/19sjg74k/7/.
Basically, what you want to do is call getData on the parent table and setData on the child table.
const crewLeaderTable = Tabulator.prototype.findTable('#CrewLeaderTable')[0];
const crewMemberTable = Tabulator.prototype.findTable('#CrewMember1Table')[0];
const crewLeaderData = crewLeaderTable.getData();
// You could also use replaceData or addData, depending on the requirements
crewMemberTable.setData(crewLeaderData);
I am trying to use the values in a given column as a hyperlink using Shield UI's Grid. There doesn't appear to be anything on making a value within a column a hyperlink in the documentation.
Does anyone have an idea how to make a hyperlink within the grid?
example:
File_001 (href="\somefolder\File_001.pdf")
File_002 (href="\somefolder\File_002.pdf")
etc...etc...
You can use the column format option to add custom HTML markup in your cells like this:
columns: [
{ field: "id", width: "70px", title: "ID" },
{ field: "name", title: "Person Name" },
{ field: "company", title: "Company Name" },
{
field: "email", title: "Email Address", width: "270px",
format: function(val) { return '' + val + ''; }
}
]
How can I change textbox height and width in a popup on devexpress mvc datagrid? I am using
#(Html.DevExtreme().DataGrid().Columns(c => {
c.Add().DataField("MyField").Visible(true).AllowGrouping(true);
}
I tried c.Add().DataField("Myfield").Width(100) but it is only working in datagrid; it does not work in popup element
First of all you need to know that you are treating with a Form and not with a simple grid, so you basically have to configure the form EditorOptions
So in jQuery it would be like this
$("#datagrid").dxDataGrid({ ,
"editing": {
"form": { items: [{dataField:"yourField",editorOptions:"width:100%"}]}
}
});
The previous answer is a little old and doesn't work now so I'll give an updated answer.
This would change the width for a field in the popup form:
$("#datagrid").dxDataGrid({ ,
"editing": {
"form": {
items: [{
dataField:"yourField",
editorOptions: {
width: "100%"
}
]}
}
});
Also if you wanted to have more control and use groups and set things, like height, you could use:
$("#datagrid").dxDataGrid({
editing: {
mode: "popup",
allowUpdating: true,
popup: {
showTitle: true,
title: "Message",
labelLocation: "top"
},
form: {
items: [
{
itemType: "group",
caption: "My Fields",
items: [
{
dataField: "Field1",
editorOptions: {
height: 200
}
},
{
dataField: "Field2",
editorOptions: {
value: true
}
}
]
}, {
itemType: "group",
caption: "My other fields",
items: [
{
dataField: "field3",
helpText: "Example: +1(111)111-1111"
}
]
}
]
}
}
});
Notice that with and without grouping both use the editorOptions to control each field.
I added a select2 and it always show first option as blank.
just below the blank option, it always shows what i type in select2 textfield. Any Idea, how i can fix it.
= hidden_field_tag :tags // present in HAML form
// javascript
$('#tags').select2
createSearchChoice: (term, data) ->
if $(data).filter((->
#text.localeCompare(term) == 0
)).length == 0
return {
id: term
text: term
}
return
multiple: false
data: [
{
id: 0
text: 'story'
}
{
id: 1
text: 'bug'
}
{
id: 2
text: 'task'
}`enter code here`
]
Try this .....
Your input field should be like this
%input#tags{:style => "width: 300px", :type => "hidden"}
Your js code should be like this
$("#tags").select2({
placeholder:"Select an option",
createSearchChoice: function(term, data) {
if ($(data).filter((function() {
return this.text.localeCompare(term) === 0;
})).length === 0) {
return {
id: term,
text: term
};
}
},
multiple: false,
data: [
{
id: 0,
text: 'story'
}, {
id: 1,
text: 'bug'
}, {
id: 2,
text: 'task'
}
]
});
You no longer need to use createSearchChoice if you want to do this with Select2, you can just use the tags option. Right now you shouldn't be seeing the blank option, as you aren't passing one to Select2 at all, so this is lacking a bit of information that would explain that issue.
Select2 will automatically hide blank options though if you have a placeholder set, which I would always recommend. So the hacky solution is to set the placeholder option to whatever you want ("Select a few tags..."), but that only works if this is actually a blank option and not just a CSS issue. You can tell if it's a blank option if Select2 highlights it whenever you start searching, as it will automatically highlight the first option.
It would make more sense for this to be a CSS issue, maybe a bit too much padding somewhere, as the tag (or choice from createSearchChoice) should be inserted automatically at the top of the search results. So even if there was a spare blank option sitting around, it would show under the newly created search choice.
I am having an issuing changing the title dynamically in a chart. I am following the workaround here to change the chart title in such a way that the change is reflected when exporting the chart. This workaround is referenced in the bug report here. However, when you click the "Set Title" twice in the workaround example the chart tile loses its formatting. Is there any way to work around this?
chart.setTitle( { text: 'Head Count Terminations' }, { text: 'Sales' } );
chart.options.title = {
text: 'Head Count Terminations'
};
chart.options.subtitle = {
text: 'Sales'
}
Thanks in advance.
It probably loses its formatting because the entire title object is replaced. What about only setting the text property?
chart.setTitle( { text: 'Head Count Terminations' }, { text: 'Sales' } );
chart.options.title.text = 'Head Count Terminations';
chart.options.subtitle.text = 'Sales';
You can avoid that issue, by overwriting exportin buttons and options for export.
Example: http://jsfiddle.net/HvHVU/
Function:
function exportActualChart() {
this.exportChart({}, {
title: {
text: this.title.text
},
subtitle: {
text: this.subtitle.text
}
});
}
Chart options
exporting: {
buttons: {
exportButton: {
menuItems: [{
text: 'Standard export',
onclick: function () {
this.exportChart();
}
}, {
text: 'With new title',
onclick: exportActualChart
},
null,
null]
}
}
}