Adding addition tabindex option to open in New tab from list view portal

DB1
Tera Contributor

Hello All,

I have a cloned widge of Copy Data Instance from table "Instance with Table [sp_instance_table]" and is there a way that open in new tab could be added along with "show matching" etc

DB1_0-1669291800736.png

 

@Ankur Bawiskar @Mark Roethof @Community Alums @Mohith Devatte @Anil Lande @Jaspal Singh 

Open in New tab or ctrl option from Portal list view

Please advise 

Also, is there a way to change the backend/help text of the search from "Keyword Search" to something else?

 

I am looking for options to open any Incident record in a new window when selected from the data table cloned widget

 

Thanks,

DB

3 ACCEPTED SOLUTIONS

@DB1 Did the solution solve your problem? 

So my code  would have created a new button and when you click on the button it opens the record in new window

 

if not let me know if you need any alternative

 

If this solved the issue can you please mark the answer correct and close the thread so that it will be helpful for others in future?

View solution in original post

@DB1 but i can see the OOB code is this in my PDI .Did you change any code ?

just replace your widget id in the last line instead of test

 

(function(){
	/*  "use strict"; - linter issues */
	// populate the 'data' object
	var sp_page = $sp.getValue('sp_page');
	var pageGR = new GlideRecord('sp_page');
	pageGR.get(sp_page);
	data.page_id = pageGR.getValue("id");
	$sp.getValues(data);
	if (data.field_list) {
		data.fields_array = data.field_list.split(',');
	} else {
		data.field_list = $sp.getListColumns(data.table);
	}

	if (input) {
		data.p = input.p;
		data.o = input.o;
		data.d = input.d;
		data.q = input.q;
	}
	data.p = data.p || 1;
	data.o = data.o || $sp.getValue('order_by');
	data.d = data.d || $sp.getValue('order_direction');

	data.page_index = (data.p - 1);
	data.window_size = $sp.getValue('maximum_entries') || 10;
	data.window_start  = (data.page_index * data.window_size);
	data.window_end = (((data.page_index + 1) * data.window_size));
	data.filter = $sp.getValue("filter");

	var gr = new GlideRecordSecure(data.table);
	if (!gr.isValid()) {
		data.invalid_table = true;
		data.table_label = data.table;
		return;
	}
	data.table_label = gr.getLabel();

	options.table = data.table;
	options.fields = data.field_list;
	options.o=data.o;
	options.d= data.d;
	options.filter=data.filter;
	options.window_size=data.window_size;
	options.view = data.view;
	options.useInstanceTitle = true; // to make sure Data Table widget uses headerTitle always
	options.headerTitle = options.title;
	options.show_breadcrumbs=true;
	options.enable_filter=true;
	data.dataTableWidget = $sp.getWidget('test', options);
})();

 

 

View solution in original post

@DB1 Sure in the client controller i handled the redirection part in this below function at the top of your client controller script find it and replace it with below code 

c.openRecord=function(id)
{
window.open("/sp?id=ticket&table="+c.data.table+"&sys_id="+id ,"_blank");

}

 

Hope this helps 

Accept this solution if it helped you 

Thanks

View solution in original post

24 REPLIES 24

@DB1 Can  you paste a screenshot of the widget from portal once?

 

Can you see any new columns called actions and a button named "Open record " under that column for every row?

I do see them and thanks a lot! now the list layout has changed though. Looks different although the parent record has the right columns

@DB1 Did the solution solve your problem? 

So my code  would have created a new button and when you click on the button it opens the record in new window

 

if not let me know if you need any alternative

 

If this solved the issue can you please mark the answer correct and close the thread so that it will be helpful for others in future?

Sure Mohith how to change that "Keyword Search" help text on the search field

Also, how to change the list layout

@DB1 in HTML of inner widget go to 17th line and you can see the word key word search and then replace it with your text