How to to use Javascrript querySelector to select the edit button of FilePond? - filepond

$('.filepond--action-edit-item').on('click',function(){ console.log($(this)); });
Wish i could do something when click on the edit button of each item.

Related

How to select a dropdown item from listbox in cypress

I have dropdown list where in html it is specified as "role = listbox" and I want to select any specified item from dropdown.
I tried with cy.get(....).click() to first click on dropdown and then click on dropdown with .contains
importp.product().click()
.get('[class="visible menu transition"]')
.contains("Reading").trigger('mousemove')
.click();

Slickgrid select row on right click before displaying context menu

Using this I can display a menu by right clicking a cell:
// right click context menu
grid.onContextMenu.subscribe(function (e) {
e.preventDefault();
var cell = grid.getCellFromEvent(e);
//grid.setSelectedRows(cell.row);
$("#contextMenu")
.data("row", cell.row)
.css("top", e.pageY)
.css("left", e.pageX)
.show();
$("body").one("click", function () {
$("#contextMenu").hide();
});
});
However I would like the row to be selected, both as visual confirmation that the correct row has been right-clicked, and because some of the menu items use the selected row for their functions.
This:
grid.setSelectedRows(cell.row);
doesn't work. What is the correct way?
It might be as simple as the fact that setSelectedRows takes an array of row indexes.
Try
grid.setSelectedRows([cell.row]);

How to add label in navgrid

I use jqgrid.I want use label in navgrid and dynamic change label text.
I can add button by navButtonAdd.
how to add label in navgrid?
Use the caption property of jqGrid navGrid. As given in the Wiki you can see that for existing navGrid buttons you can use the property addCaption/editCaption in case of Edit and caption in case of others to set the label.
As
caption: "Delete",
Since this is a string value you can directly assign a variable dynamically to set the label
If you really need to modify the text of the buttons added by inlineNav or navGrid you have to do this manually because jqGrid has no simplified function for this.
First of all you can use Developer Tools of Internet Explorer (press F12 to start), Firebug or other tools to examine the navigator buttons. You will see something like
The id of every button are constructed from the id of the grid and some button specific suffix. For example the "Edit" button added by inlineNav is "list_iledit" where "list" is the id of the grid and the suffix "_iledit"has the Edit button. To change the texts later you can use the code like
var $div = $("#" + grid[0].id + "_iledit>.ui-pg-div");
var $icon = $div.find(">span.ui-icon");
$div.text("edit"); // new text of the button
$div.append($icon);
$div.parent().attr("title", "my custom edit tooltip"); // new tooltip
You can use something like this:
.navGrid('#pager_list_1', {
//other codes
}).navButtonAdd('#yourpagerId', {
caption: "Del",
url: delUrl,
buttonicon: "ui-icon-trash",
onClickButton: function (response) {}
}

how to show tooltip in jqgrid edit/add form buttons

I tried
grid.navGrid("#grid_toppager",{},
{
bSubmit: 'Submit',
editCaption: 'Edit',
title: 'Save changes (Ctrl+S)' } );
but Save changes (Ctrl+S) tooltip does not appear if mouse is over Submit button. how to show tooltip in edit and add form submit buttons ?
There are no title option of navGrid method. There are only options like edittitle or addtitle which are not what you need.
What you need is to set title attribute on the "Submit" button which you have to do directly inside of beforeShowForm for example. See the demo.
If u want to add tooltip on your custom jqgrid buttons then just add title .
.navButtonAdd('#discPgr',{ title:"Add Discount" });

jqgrid check before clicking add button

for a treegrid i want to enable the add button only if a record is selected. if that is not possible on clicking the add button i would like to see if the rowid selected is not null.
Any ideas i tried the beforeshowform i could not figure out how to skip adding the form.
beforeShowForm: function(formid) {
var rowid = jQuery("#treegrid").getGridParam('selrow');
if(rowid == null ) {
return[false,"Please select a row."];
} else {
return[true,""];
}
}
Please help!
In the old answer I created the demo. In the demo I made the first row 'not-editable-row' so the "Add" and "Edit" buttons from the navigation bar will be disabled on the row selection. If one selects the second row the "Add" and "Edit" buttons will be enabled. If one unselect the row, so no rows are selected the "Add" and "Edit" buttons will be disabled one more time.
You can use the same idea in case of the treegrid.

Resources