UIkit 2 - How trigger pagination page - getuikit

I have a function "go to" in my page, I already tried to update "currentPage" property in the instance but this doesn't worked.
Once UIkit doesn't have a specific method to change page, there is a way to do it?

Actually, diging a little more into the files of the lib, I found a method "selectPage" that is available in the instance.
this.pagination = UIkit.pagination('.uk-pagination');
this.pagination.options.items = itemsCount;
this.pagination.options.itemsOnPage = itemsPerPage;
this.pagination.init();
this.pagination.selectPage(parseInt(this.goToPage - 1, 10));

Related

Meteor - Binding to element on initial template render throws error

I am using Meteor, FlowRouter, and Parsley for validation. When I reload the app and enter into the page with the form, I get this error and parsley is not working on the form:
You must bind Parsley on an existing element.
If I leave the page and come back, it works fine. I have the following code initializing the binding:
Template.report.onRendered ->
report = Reports.findOne(_id: FlowRouter.getParam('reportId'))
if report.status == 'finalized'
Session.set('showDistributeReport', true)
else
Session.set('showDistributeReport', false)
$('#status-js').val(report.status)
$('#report-form-js').parsley()
I have been using Parsley and haven't seen this problem on other pages. Any help would be greatly appreciate.
I figured out a fix but I'm not sure why I had to do this. If anyone has any input that would be great. I had to take the portion where I set the session variable and move it to the onCreated method. This is the code I have now.
Template.report.onCreated ->
report = Reports.findOne(_id: FlowRouter.getParam('reportId'))
if report.status == 'finalized'
Session.set('showDistributeReport', true)
else
Session.set('showDistributeReport', false)
Template.report.onRendered ->
report = Reports.findOne(_id: FlowRouter.getParam('reportId'))
$('#status-js').val(report.status)
$('#report-form-js').parsley()

django cms - put existing plugin instance into placeholder

The custom CMSPlugin my_plugin has been saved already.
Now, I would like to put it into the placeholder my_placeholder.
my_plugin.placeholder = my_placeholder
my_plugin.save()
leads to an empty plugin in my_placeholder although my_plugin has content.
What steps do I miss?
This works:
my_plugin.placeholder = my_placeholder
my_plugin.plugin_type = CMSPluginBase_ChildClass
my_plugin.language = 'en'
my_plugin.position = 0
my_plugin.save()
It is necessary to explicitly set the plugin type, because one CMSPlugin, i.e. one class inheriting from CMSPlugin, might serve for the configuration of several classes inheriting from CMSPluginBase.
I havn't tested if defining language and position is really necessary, but it's probably a good idea.

Delete row button in alv grid in sap

i am using function "REUSE_ALV_GRID_DISPLAY" in order to display a grid. My problem is that not all the buttons in alv toolbar are displayed. For example, i can not see the "delete row" button.
This is my call:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = fieldcatalog
TABLES
t_outtab = lt_files_records_final
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
Can you please help?
IF you need the full editor functionality (including cell editors), you will have to move away from the (obsolete and unsupported) function module to the class CL_GUI_ALV_GRID. See the documentation here.
If you only need a delete button, it might be easier to add a custom button. Check the program SALV_DEMO_TABLE_FUNCTIONS for an example (and start using the ALV OM instead of the old function modules - much easier to code with).

Component will not delete

I'm doing a bit tidy of the Content Manager and have a component that won't delete (not the same as my other question).
When I try to delete the component in question I get the following error
(8004032D) This item is in use.
Unable to delete Component (tcm:4-65020).
UtilitiesBL.AssertItemCanBeDeleted
UtilitiesBL.AssertItemCanBeDeleted
ComponentBL.Delete
Component.Delete
Request.Delete
When I use the Where Used tool on the component I get no results in the "Used In" tab, one result in the "Uses" tab, the "Blueprint Hierachy" shows it is not localized in any of my three child publications and no results in the "Published To" tab.
I have had a look in the Content Manager database to see if I can spot what is going wrong but not really found anything.
Any ideas?
Thanks in advance.
It looks like the Where Used tool in R5.3 isn't working correctly. The component in question is used in 15000 other components. I found this by using the TOM API directly.
var componentID = "tcm:4-65020";
TDS.TDSE tdse = new TDS.TDSE();
var component = (TDS.Component)tdse.GetObject(componentID, TDSDefines.EnumOpenMode.OpenModeView);
var whereUsedString = component .Info.GetListUsingItems();
Now comes the task of deleting all these links...

How can you extend the default behavior of Tridion.Cme.Commands.Open.prototype._execute()?

I have written a GUI extension which adds an additional tab to many of the Item views in the SDL Tridion CME (e.g. Component, Page and Schema etc.). I have also written some JavaScript which loads that tab directly if when the view is loaded with a tab name is specified in the URL.
The result is that if a page is loaded with the tab name added as follows:
http://localhost/WebUI/item.aspx?tcm=64#id=tcm:1-48-64&tab=InfoTab
Rather than the default of
http://localhost/WebUI/item.aspx?tcm=64#id=tcm:1-48-64
The Info Tab will be loaded on top, instead of the General Tab. This is performed with the following code snippet and works very well:
$evt.addEventHandler($display, "start", onDisplayStarted);
// This callback is called when any view has finished loading
function onDisplayStarted() {
$evt.removeEventHandler($display, "start", onDisplayStarted);
var tabname = $url.getHashParam("tab");
if (tabname != '') {
var tabControl = $controls.getControl($("#MasterTabControl"), "Tridion.Controls.TabControl");
tabControl.selectItem(tabname);
}
}
Now I would like to make a context menu item to open items and link to the tabs using my new functionality. My first thought was to construct the Item URL myself and simply open a new window in my execute method. So I looked at the default functionality in the standard Open.prototype_execute() functionality of the GUI. This is stored in the navigation.js file of the CME, and is performed by the Tridion.Cme.Commands.Open.prototype._execute method. The code is a lot more complicated than I had anticipated as it deals with shared items, and permissions etc.
Rather than just copying all of this code to my own function, I was wondering if there is a way to elegantly extend the existing Open.prototype_execute() function and append my “&tab=MyTab” to the $cme.Popups.OPEN_ITEM_OPTIONS.URL constant for my own functions.
Any advice would be greatly appreciated.
At the end the Open command uses $config.getEditorUrl(item_type) to get the url for the item view (item_type - $const.ItemType.COMPONENT, etc). There are no extension points for this part of the functionality, but you could always try to overwrite it on your own risk.

Resources