How to show the Crystal Viewer with the Group Tree panel collapsed - crystal-reports

By default, the Crystal Viewer on a Web Form shows its Group Tree panel expanded, even if not used. I would like the viewer to appear with the Group Tree panel collapsed by default. Can I do that and how?

This link may be of some interest to you
http://www.codeproject.com/Tips/207643/Hide-Report-Group-Tree-in-WPF
Alternatively you can hide it altogether with the following:
[Visual Basic]
CrystalReportViewer1.DisplayGroupTree() = True
[C#]
crystalReportViewer1.DisplayGroupTree = true;
[C++]
crystalReportViewer1->DisplayGroupTree = true;
[VJ#]
crystalReportViewer1.set_DisplayGroupTree(true);

With Jquery:
$(document).ready(function() {
$("[id$=panelHeader_close]").click();
});

Related

Add source button to Magnolia CMS richText control

I need to enable source button on my richText control ( I have to put there HTML code ) and I have follow this tutorial:
https://documentation.magnolia-cms.com/display/DOCS/Rich+text
So I have added following settings source - true - Boolean in standard-templating-kit/dialogs/generic/controls/text but it doesn't work for me.
I'm using Magnolia CMS 5.2.4. Can anybody please tell me how I can turn on this button or maybe if there is another control to put there html code ?
Best Regards
Jan
Have you defined your dialogs using Blossom? If so, they are completely distinct from the STK dialogs. If you have something like the following example, you will need to change your code to set up the rich text area with a source button.
#TabFactory("heading")
public void headingTab(UiConfig cfg, TabBuilder tab) {
FieldConfig fields = cfg.fields;
tab.fields(
fields.text("headingtitle").i18n().required(),
fields.richText("headingtext").i18n().required()
);
}
The above example would be modified by defining the rich text field and then modifying the definition.
#TabFactory("heading")
public void headingTab(UiConfig cfg, TabBuilder tab) {
FieldConfig fields = cfg.fields;
RichTextFieldBuilder richText = fields.richText("headingtext").i18n().required();
richText.definition().setSource(true);
tab.fields(
fields.text("headingtitle").i18n().required(),
richText
);
}

SAPUI5: how to make select field read-only

I made a combobox using sap.m library:
var oSelection = new sap.m.ComboBox({
name: <name>,
id: <id>,
items: {
<items here>
})
},
});
Now, how do I make this field kind of read only, so when I tap it on mobile, it wouldn't bring up the mobile's keyboard, but it would bring up the selection options?
I've tried to use editable: false, but it disables the selection together with keyboard.
Thank you.
From what I could find out there's no method that allows such behaviour.
One option, that I personally would not advice, is to access the HTML DOM and disable the input field that composes the sap.m.Combobox component.
Keep in mind that if the development SAPUI5 changes the inner workings of the Combobox component your code could be broken if you update the SAPUI5 libraries.
This being said, to use this option you could do something like:
oSelection.onAfterRendering = function() {
if (sap.m.ComboBox.prototype.onAfterRendering) {
sap.m.ComboBox.prototype.onAfterRendering.apply(this);
}
document.getElementById("<id>-inner").disabled=true;
}
replace the < id>-inner by the correct id given to your component.
This was tested using version 1.22.8 of SAPUI5 development toolkit.
Use sap.m.Select instead of sap.m.ComboBox.
Select does not provide the ability to edit the field content.
In many instances the Select control can directly replace a ComboBox without any other changes to the properties or the items aggregation!

Open modal windows or popups from a Hyperlink site column

I need to open a modal window or popup from a SharePoint site column, when the user clicks on a link shown by this column.
I have tried to use these types of site columns:
Full HTML content with formatting and constraints for publishing
Hyperlink with formatting and constraints for publishing
but I don't know how exactly to use them. What should I put as content? I have tried this code from C# but that does not work:
private LinkFieldValue linkField = new LinkFieldValue();
linkField.NavigateUrl = "javascript:window.open('Pages/delete.aspx?Id='" + id +",width='300',height ='300', toolbar='no')";
linkField.Text = "Delete";
linkField.UseDefaultIcon = true;
linkField.ToolTip = "Delete";

Populate a Dynamic Field Dropdown List in OTRS

I need to add a dropdown in the New Ticket Screen of OTRS. I managed to add a Dropdown by adding a Dynamic Field with the help of Dynamic Fields Management in Admin Section.
Now my problem is that I want to populate this Dropdown with data that I get from some distant database on the run and dependin on the User Loged In. How can i feed In this Dynamic Data in the DropDown List in OTRS ?
Thank you.
To do such a thing I do not believe is supported from the Dynamic Field UI provided by OTRS.
So you can either:
1- add all the possible values into the drop down box and then hide/show them using code changes in the dtl file. (use javascript).
For creating a new ticket there is either AgentTicketEmail.dtl or AgentTicketPhone.dtl.
There is also the CustomerTicketMessage.dtl if you want to include it in the customer interface too.
2- Add only one value which you can also hide using javascript in the dtl files and just add values to the dropdown list using javascript code.
Example javascript below hides/shows different dynamic fields. You can find what your dynamic field is called by looking at the page source from your browser.
function setdynamicviews(){
switch ($('#Dest').val() ) { //this is where the queue is relevant (Dest = Queue)
case "8\|\|Support": // need to slash escape the pipes
//show dynamic fields
document.getElementById('LabelDynamicField_Product').style.display = 'block';
document.getElementById('LabelDynamicField_SerialNo').style.display = 'block';
break;
default:
//hide dynamic fields.
document.getElementById('LabelDynamicField_Product').style.display = 'none';
document.getElementById('LabelDynamicField_SerialNo').style.display = 'none';
}
}
To add items to usign javascript see here
Yuu have not provided enough information for me to help with getting the information "from some distant database"
Note: if you do change any DTL files or other otrs files you should defrinitely create a theme first see here
Hope this helps.

ASP.net MVC Set Checkboxes to checked Clientside

My situation is: Im making a simple inbox page. The inbox is a listing made from a DevExpress grid. Each row in the grid has a checkbox that the user can check so that they can multi delete records (similar to yahoo mail etc).
When the user clicks the select all link or the clear all link i need to set all the checkboxes within the grid to be checked or unchecked. How do I go about this with client-side scripting? Thanks
The easiest way to do this is to use jQuery. With the right selector it's pretty much a one liner. I don't know how much you know about jQuery so here's a link to the selector docs if you want to read up:
http://api.jquery.com/category/selectors/
The selector will depend on the layout of your page. I've done it before using something like this:
$("#tableId tr td input:checkbox").attr("checked", true);
In this example all checkboxes within a table with an id of "tableId" are checked
Using jquery it should be pretty easy- assuming you can use one of the selectors to select all of the checkboxes (take a look at the different jquery selectors http://api.jquery.com/category/selectors/).
Attach a toggle handler:
$('Selector for the "select all" checkbox>').toggle(function() {
alert('First handler for .toggle() called.');
}, function() {
alert('Second handler for .toggle() called.');
});
Select all checkboxes and when toggled switch the checked state of the other checkboxes:
$('<Selector for the ones you want to toggle>').attr('checked', true);
Provide some sample HTML, or a link to a page, if you need further help.
So putting it together, assuming your "select all" checkbox had an ID of "uxSelectAll" and the ones you want to change have a CSS class of "checkbox-mail-items" it would be something like:
$('#uxSelectAll').toggle(function() {
$('.checkbox-mail-items').attr('checked', true);
}, function() {
$('.checkbox-mail-items').attr('checked', false);
});
you can create a delegate (jquery) for all the checkboxes once you've done the answer above. with something like to perform an action for each check box:
$('div.myGridDivClass tbody').delegate(':checkbox', 'click', function(){
var $checkedRow = $(this), $row = $checkedRow.closest('tr')
// check row is checked
// toggleclass for checked css class and apply to the $row or whatever u want
// do something here
});