I have an APEX tabular form, all columns of which are standard report columns.
Is it possible to display a tooltip on mouse over of a particular cell of the report?
In the report column attributes look for the region named Column Formatting. Inside this section is a text box for an "HTML Expression". Here you can add html to the report column contents e.g., <span title="My tooltip text">#COLUMN_NAME#</span>
The tooltip text could be from another column, you would just replace the contents of the title attribute with the column name surrounded by hashes.
SOLUTION 1:
If your record needs to be editable then this solution works:
Under column attributes go to LINK
For Target: Type - URL and URL is just a hashtag
URL: #
Link Text: &COLUMN_NAME.
Link Attributes: title="&COLUMN_NAME." class="column_name_class"
Then in your inline CSS add the following
.column_name_class{
text-decoration: none !important;
}
Solution one I definitely prefer. But here is solution 2 anyways.
SOLUTION 2:
See here for the solution on JSDoc: Widget Grid
You can also initialize the grid with the tooltip option specified.
function( options ) {
options.defaultGridViewOptions = {
tooltip: {
content: function( callback, model, recordMeta, colMeta, columnDef ) {
var text;
// calculate the tooltip text
return text;
}
}
};
return options;
}
} );
Calculating the tooltip :
config.defaultGridViewOptions = {
tooltip: {
content: function( callback, model, recordMeta, colMeta, columnDef ) {
return model.getValue( recordMeta.record, "COLUMN_NAME");
}
}
}
Related
I'm using react-native-render-html library to display data from Django Rest Framework stored in RichTextUploadingField from django-ckeditor. As basic styling is working properly I have a problem with the <ul> tag - text is not centered with circle/square/number as shown in the image. I tried using renderersProps like:
<RenderHTML renderersProps={{ ul: { markerBoxStyle:{ paddingRight: 3, top: 5 }, markerTextStyle: { color: "red" } } }} />
But it works for specific text size. If I change the text size in style in Django admin, the element and text aren't centered again. Is there any option on how to fix it or what causes the problem?
You could add a custom CSS class to unordered list items only. Then apply your styles to that CSS class.
// this function goes through every list item in <ul> only and adds your custom class ('ul-li' in my case)
const onElement = (el) => {
const { children, name } = el;
if (name === 'ul' && children && children.length) {
children.forEach(listItem => listItem.attribs = {class: 'ul-li'})
}
}
// define your styles for your custom class
const classesStyles = {
"ul-li": {
lineHeight: '21px', // for me adjusting lineHeight did the job
}
}
// in your JSX
<RenderHtml
source={source}
contentWidth={width}
tagsStyles={tagsStyles}
... // other props you may have
domVisitors={{onElement}} // first alter your html
classesStyles={classesStyles} // then apply styles
/>
Sources:
classesstyles
onElement
I have been asked if I can modify my oracle apex interactive grid to make the row selector column wider, bold and add a title is possible. I know how to do this for a column but I am not sure it is possible for an interactive grid row selector. Any help or an example would be helpful.. Thank you
Wow, this was a tricky one. I think I've figured it out (many thanks to John Snyders!). Assuming the IG has an id of 'emp', the following should work:
Add the following CSS to the page's Inline property under CSS. This will handle the styling of the checkbox, the checkmark in the checkbox, and it will show the column's header which is hidden by default. You can remove the #emp selector if you want to target all IGs on a page.
/* Style the box */
#emp .u-selector {
border: 2px solid #000;
padding: .5px;
}
/* Style the check in the box */
#emp .u-selector:before {
font-weight: 900;
color: #000;
}
/* Show the row selector column header */
#emp .a-GV-headerLabel {
position: relative;
}
#emp .a-GV-table th {
white-space: normal;
}
Next, add the following JavaScript code to the page's Execute when Page Loads property under JavaScript.
var igRegionId = 'emp';
var widgetInst = apex.region(igRegionId).call('getViews').grid.view$.data('apex-grid');
var orgRefresh = widgetInst.refresh;
widgetInst.refresh = function() {
orgRefresh.call(widgetInst);
$('.u-vh.a-GV-headerLabel').text('Hello World!');
};
widgetInst.refresh();
Finally, add the following JavaScript to the IG region > Attributes > JavaScript Initialization Code. This will resize the column as needed:
function(config) {
config.defaultGridViewOptions = {
rowHeaderWidth: 100
};
return config;
}
I'm displaying my results on an interactive grid. I'd like to be able to select multiple rows and click an edit button that will open up an “edit” form. I am having a number of problems:
Retrieve the car IDs of the rows selected. (I am having trouble accessing column values, I can access item values)
Pass a collection or array of ids to the edit form.
Save the collection.
Added more code in answer box by accident...……..
I made some progress but I am a little stuck. I followed the oracle blog and it was vey helpful. So on the attribute of the region I added the following code:
function (config) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = toolbarData.toolbarFind("actions3");
toolbarGroup.controls.push(
{
type: "BUTTON",
action: "updateCar",
label: "Edit Selected Cars",
hot: true,
});
config.toolbarData = toolbarData;
config.initActions = function (actions)
{
// Defining the action for activate button
actions.add(
{
name: "updateCar",
label: "Edit Selected Cars",
action: updateCar
});
}
function updateCar(event, focusElement)
{
var i, records, model, record,
view = apex.region("ig_car").widget().interactiveGrid("getCurrentView");
var vid = "";
model = view.model;
records = view.getSelectedRecords();
if (records.length > 0)
{
for (i = 0; i < records.length; i++)
{
record = records[i];
//alert("Under Development " + record[1]);
vid = vid + record[1] + "||";
apex.item("P18_CAR").setValue(vid);// This is not needed just to test
//the output
// call next page
// pass array as sql source or directly on page
}
}
}
return config;
}
This works. A button is displayed and when selected it gets the values from the interactive grid. The part I am stuck is how to call the next page and pass the multiple values (2 columns) to the page to be displayed and in a query to do an update.
Thank you if you can help me accomplish this!
i had already done adding a click handler to each Segment of my doughnut chart with adding the following Code :
$("#myChart").click(
function(evt){
var activePoints = myNewChart.getSegmentsAtEvent(evt);
var chartelementid = activePoints[0].label;
alert(chartelementid);
//$('.details div').css("display", "none");
//$('#' + chartelementid).show();
}
);
This works fine, when finished it should display an additional Div with Details for this segment.
Unfortunality my labels are more then just Single Words, so i'm struggeling to create div ID's with the same name...
My Idea is to add to every Segment an additional Data like value,label, etc. so it could be an ID. but if i just add the ID information to the Segment it will not exist as variable.
Add DataType:
var dataImprove = [
{
value: 30,
color:"#001155",
highlight: "#1c2f7c",
label: "KnowHow Erhalt / Transfer & Aufbau",
id:"test"
}
]
where can i add in chart.js an additional dataType like shown above my ID to be accessible in the DOM?
kind regards Marco
As an alternative pass a JSON string as your label, then intercept to render. For example:
var canvas = document.getElementById(id);
var d = canvas.getContext("2d");
var chart = new Chart(d).Pie(json, {
segmentStrokeWidth: 1,
tooltipTemplate: "<%=label%>", //default the label
customTooltips: function (tooltip) {
// Hide if no tooltip
if (!tooltip) {
return;
}
var tooltipObj = JSON.parse(tooltip.text);
// etc
already found : between line 999 and 1023 in chart.js before drawing - i've added the line
id: ChartElements[0].id,
so the Data with the name ID is in the DOM avaiable.
Just asked a question on regular expression here, basically we need to give an option to people to select some part of text which will be hidden with a MORE button on flash front end, and when some one will click on MORE it will expand it. here is sample text in tinyMCE
some text <start> some inner test </end>
so here is the regular expression to catch this start and end text,
<start>(((?!<(?:\/end|start)>).)+)<\/end>
the above expression will be used to strip this SOME INNER TEST and we will convert this to FLASH friendly MORE button.
My question is, Is there any way to highlight the text inside start & end tags on the fly (while editing) so people will know which part will be hidden for MORE button
Okay guys pat my shoulder on this :D If you don't know what are the code below then learn the basic of TinyMCE initializing. I have done this on jQuery version.
Here is my solution
var highlighter = 1; // A global variable, just to create a toggle for show/hide highlight
added three custom buttons
theme_advanced_buttons1: 'startmore, highlight, endmore, ...';
add setup: to initializing code.
// start highlight, end highlight and show highlight buttons
setup: function(ed) {
ed.addButton('startmore', {
title: 'Start More',
image: 'images/end_s.png',
onclick: function() {
ed.selection.setContent('[start]');
}
});
ed.addButton('endmore', {
title: 'End More',
image: 'images/end_m.png',
onclick: function() {
ed.selection.setContent('[end]');
if (1 == highlighter) {
highlight_tags();
}
}
});
ed.onInit.add(function(ed) {
highlight_tags();
});
ed.onSubmit.add(function(ed, e) {
var html_output = highlight_remove(tinyMCE.activeEditor.getContent());
tinyMCE.activeEditor.setContent(html_output);
});
ed.addButton('highlight', {
title: 'Show collapse selection',
image: 'images/end_highlight.png',
onclick: function() {
if (1 == highlighter) {
var html_output = highlight_remove(tinyMCE.activeEditor.getContent());
tinyMCE.activeEditor.setContent(html_output);
highlighter = 0;
} else {
highlight_tags();
highlighter = 1;
}
}
});
ed.onContextMenu.add(function(ed, e) {
tinymce.dom.Event.cancel(e);
if (1 == highlighter) {
highlight_tags();
}
});
}
onContextMenu is used to show / fix the highlight by right-clicking inside the editor.
There are issue to show highlight on they fly as as soon I setSontent() it moves the cursor at the start of first line.
Below are the regular expression functions to put the highlight around the [start][end] tags.
function highlight_tags() {
var html_output = tinyMCE.activeEditor.getContent();
html_output = highlight_remove(html_output);
var regex = new RegExp(/\[start\](((?!\[(?:end|start)\]).)+)\[end\]/ig);
html_output = html_output.replace(regex,'<span style="background-color:> yellow;">[start]$1[end]</span>');
tinyMCE.activeEditor.setContent(html_output);
}
function highlight_remove(html_output) {
var regex_fix = new RegExp(/<span\sstyle="background-color:\syellow;">(.+?)<\/span>/ig);
return html_output.replace(regex_fix,'$1');
}
Hmm so far it is serving me.
Just onSubmit I am trying to remove the highlight so it wont go in database and for a second I can see that highlight is removed. But it goes in database... so fixing this now.
Let me know if you guys didn't understand any part.
NOTE: If there is any typo in code that might be this stack overflow editor :).
NOTE: I know this code can be improved a lot, so enlighten me please.