Solved

jTable adding custom buttons

Posted on 2016-10-15
1
25 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

762 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

23 Experts available now in Live!

Get 1:1 Help Now