Solved

jTable adding custom buttons

Posted on 2016-10-15
1
38 Views
Last Modified: 2016-10-15
Hello experts
I m using jquery jTable and i need help to add a custom button in the pop up window for editing  one item
I found something similar to my problem that is using the display function here :
http://stackoverflow.com/questions/16747730/add-custom-button-in-jtable
This is working if list is true. If list is false (for showing this only in the pop up window , i get a textbox and not a button.
Any idea how to fix this?
 MyButton: {
                title: 'Validation Rules',
                width: '40%',
            list: false,
                display: function(data) {
                     return '<button type="button" onclick="alert()">Add</button> ';
                }}

Thank you for any help.
0
Comment
Question by:Panos
1 Comment
 
LVL 2

Accepted Solution

by:
Panos earned 0 total points
ID: 41844957
I have a solution for this problem and share this here for any one else with the same problem
I modified the jsTable plugin  _createInputForRecordField function on line 1003
I added an if - else statement before //Create input according to field type code like:
 if (field.display) {
                return field.display({ record: record });
            }
                  else{
            //Create input according to field type
      ......all the stuff
}
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Correct this jQuery code for opening div. 24 20
Css issue on scroll 1 38
Angular - where do I need to put this code? 3 29
Angular - break the dataset in chunks? 7 40
Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now