Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
_jespers_
Partner - Creator II
Partner - Creator II

CreateBookmarkEx not working as it should

I have an issue that arise when I try to use the CreateBookmarkEx-method within an extension using QIX.

 

If I first go to a published application, makes some choices in a table and rearrange the columns.

Then I use the Engine API explorer and create a bookmark using CreateBookmarkEx:

bild01.png

The bookmark is created with the option use current layout setting set to "saved":

bild02.png

 

But if then create an extension and use QIX and createBookmarkEx-method within the same application (within the same session as when I made the call in the Engine-API explorer), the bookmark is created but the option use current layout setting is not set to "saved":

 

 

define( ["qlik", "text!./template.html"],
	function ( qlik, template ) {	
		return {
			template: template,
			support: {
				snapshot: false,
				export: false,
				exportData: false
			},
			paint: function ($element, layout) {
				var app = qlik.currApp(this);
				var qix = this.backendApi.model.enigmaModel.session;

				qix.app.createBookmarkEx({
					"qProp": {
						"qInfo": {
							"qId": "",
							"qType": "bookmark"
						},
						"qMetaDef": {
							"title": "bookmark-test-02",
							"description": "desc"
						}
					}
				});		

				return qlik.Promise.resolve();
			},
			controller: ['$scope', function ( $scope ) {
			}]
		};
	} );

 

 

 

bild03.png

Since the bookmark is created the method exists, but it doesn't seems to work in the same way as it does in the Engine API-explorer. What can I do so that the layout setting is being set to saved?

 

Regards

Jesper

Labels (2)
1 Reply
christianborg
Partner - Contributor II
Partner - Contributor II

Good morning @_jespers_ 

I've successfully executed code similar to the one you shared and was able to save the layout. Nevertheless, even though the bookmark indicates that the layout is saved (marked as "saved layout: True"), in practice, the layout doesn't seem to persist. For instance, fields in a table revert to their default positions. Have you encountered and resolved this issue?

var app = qlik.currApp(this);
var qix = this.backendApi.model.enigmaModel.session;
var sheet_id = qlik.navigation.getCurrentSheetId().sheetId;

qix.app.createBookmarkEx({
			"qProp": {
			"qInfo": {
				"qType": "bookmark"
				},
			"qMetaDef": {
			"title": "Bookmark with Layout",
                	"description": "Bookmark with Layout",
                	"isExtended": true
			},
			"sheetId": sheet_id
			}
});		

return qlik.Promise.resolve();

christianborg_0-1699258644355.png