Solved

jTable adding custom buttons

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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…

856 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