JQGrid - Add buttons to a Form Edit dialog - forms

I have been using JQGrid for about a year now and I love it. Just wondering if someone knows a way to add a button or two that will trigger my own code on a Form Edit page? Not on the grid itself - the edit dialog.
Would I just use the onInitializeForm event?
Thanks!
Jim

I used jQuery to do this. In my case I had a drop-down select item as a field on the edit for and I wanted to add a link next to it. I used the beforeShowForm event.
beforeShowForm: function(form) {
$("#MyDropDownList").after("<a href='#' id='link'>A Link To Something</a>");
},
Hope this helps, even though it's a few weeks late.

Related

primeng accordion header button

I have Angular 5 application and I am using PrimeNG components. I created the PrimeNG accordion with defined header where are the title and some action buttons, like this:
<p-accordion>
<p-accordionTab>
<p-header>
<span>Some card title</span>
<p-button title="Delete" (onClick)="deleteCard()"></p-button>
</p-header>
</p-accordionTab>
</p-accordion>
Issue is that when I click on the button inside accordion header, the particular accordionTab fire toggle open/close click event, which looks very weird. How I can separate these two clicks?
Thanks for advice.
I know this is an old post, but I'm posting for anyone that comes across this like I did.
In the click method of the button, add $event.stopPropagation(); followed by your own event, such as deleteCard() like in OPs post.
<p-accordion>
<p-accordionTab>
<p-header>
<span>Some card title</span>
<p-button title="Delete" (onClick)="$event.stopPropagation(); deleteCard()"></p-button>
</p-header>
</p-accordionTab>
</p-

TinyMCE get form content without using submit button

I'm trying to put TinyMCE on my website. I figured out how to get it to show up, but I'm lost on how to process the content. In their example, they just have a link that references the top of the page and clicking on it somehow magically causes their dump.php script to execute. I don't understand what's going on here. Here is the link:
http://www.tinymce.com/tryit/basic.php
The "Submit" button at the bottom is really a link in a span element with href="#". The form action is dump.php. I want to know how they configured this to run without an actual submit button. Any help in understanding this is greatly appreciated!
To Get Content From Tinymce You Can Use GetContent Method of Currently ActiveEditor Instance
tinyMCE.activeEditor.getContent();
method is used to getting Content .. to Set The Content
tinyMCE.activeEditor.setContent("I Want Text To Be in Tinymce");
to find a perticular element in tinymce get body and find element
var body = tinyMCE.activeEditor.getBody();
$(body).find("#elem_id")
to get a full html
tinyMCE.activeEditor.getDoc().documentElement.innerHTML
hope that helps ..
Since I use PHP, I found this which is also useful:
http://www.tinymce.com/wiki.php/TinyMCE3x:How-to_implement_TinyMCE_in_PHP

Preventing page jump - hashed anchor tag - default behavior

I made a type of menu box with css click events using targets and link them with hash anchor tags. The problem is, when I click one of the buttons (One, Twii, Thrii, etc.) the page jumps! I tried using a js script to stop the default behavior but to no luck. Could you please help me stop the page jump so the page does not move when a button/link is clicked!
Heres the JS Fiddle link I made. jsfiddle.net/3ASpX/1/
I need a solution..whether its with using target or something else!
Thank You and I apoligize for any confusion in explanation and the question itself if I have done something wrong, your help is much much much appreciated.
I think you could do this by using <div> instead of <a>.
But if you have to use an <a>, you could remove the target with jQuery:
$( '.link' ).removeAttr("href");

Does Pinterest button have a callback?

I need to unlock content when someone shares the post with pinterest, and I can't find a callback function on pinterest button. Is there any way to do this?
You could wrap the pinterest link with a span and add a jQuery click event to the span to at least know that the pinit button was clicked. That's about the best you can do until they release a real callback so you can know that an item was actually pinned.
<span id="pin-container"><a data-pin-config="beside" href="http://pinterest.com/pin/create/button/?url=[your_url]&media=[your_image]&description=[your_desc]" data-pin-do="buttonPin" ><img src="//assets.pinterest.com/images/pidgets/pin_it_button.png" /></a></span>
$('#pin-container').click(function () {
alert('clicked pin button');
});
A workaround is posted here:
http://www.lunametrics.com/blog/2012/03/12/tracking-pinterest-event-tracking/
Until Pinterest opens up a public API and a non-iFrame tracking button, this is about as good as you'll get.
As said before, the API is not public yet. The best workaround (I just tested it, and it works in my scenario) that I've found so far is http://www.seomoves.org/blog/tools/tracking-pins-with-the-pinterest-button-2595/
That link only lets you determine if the Pin Button was clicked, not if they actually made the share. Hope that helps a little!

How do you programatically remove (not disable) a button from TinyMCE?

I can disable the table button using this:
tinyMCE.activeEditor.controlManager.get('divId_table').setDisabled(true)
but what I'm interested in is actually hiding it. Any idea on how to accomplish that?
Thank you!
First, you have to use the advanced theme.
Then, add this option in the TinyMCE init code.
tinyMCE.init({
...
theme_advanced_disable : "bold, justifyleft, justifyright"
});
I hope this might help someone.
source
list of elements' name here
I'm not familiar with TinyMCE myself, but since you appear to have javascript access to the element itself, all you need to do is set it's display property to "none".
document.getElementById("theButton").style.display = "none";
incase ur trying to hide a specific button, use the following code.
$('.mce_cut').hide() //hides cut button
lookup other button titles using firebug in case u wish to hide something specific.
Incase you are looking to hide specific editor's button, modifiy the jquery selector to select correct sibling/descendent.
alternately, try this ..
tinyMCE.activeEditor.controlManager.controls.ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords_cut.remove()
Note that ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords is my asp.net control's id. Don't bother about this if ur not using Asp.net serverside textbox control. In case you are.. <% theTextBoxID.ClientID %> gets u that.
Use the following (using jQuery; a non-jQuery approch is easily built):
var elem = $(ed.id+'_'+'divId_table')
elem.addClass('mceButtonDisabled');
elem.removeClass('mceButtonEnabled');