I've been trying to get this free alternative editor I found here to work but it keeps on blowing up on me because I am terrible at javaScript. Been debugging, reading documentations like mad all day but my scrub mind is out of ideas but I'm still trying anyway.
I deleted some of the stuff it had in there like ajax to server,the ID row, because I don't need those, I just want to be able to insert, edit, and delete rows in the table while keeping the <option> dropdown and pattern validation.
I prepared a jsfiddle with my exact setup here. Any hints/help will be greatly appreciated.
Managed to figure it out myself.
This jsfiddle is an updated version that works.
This diff shows the modifications I made compared to the original.
What is the point you ask?
The point is to be able to validate stuff before adding/editing them, to have a neat dropdown select, and to be able to send the data from the table itself as a JSON string in a "Column Name" : "Cell Data" format so that I can json_decode($_POST['table'] and use a nice associative array to add the data to my database.
Why?
Beats me, do what you want with it. I plan to use it to send a list of addresses one way only to the server.
Why not use the official editor?
Because I can't justify the price for my meaningless project and I hardly need 10% of what it offers.
Big thanks to Kingcode.com where I found the free datatables editor alternative and KasperOlesen for making it more awesome.
Related
Is it possible to add a total row in inputs.Table from Observablehq? The idea is to have a column aggregate such as sum or mean. I searched through the inputs.Table documentation, but it does not seem to mention this option. In addition, I could not find any notebook showing this option either. If this option is not implemented in inputs.Table, do you believe it is feasable to improve the source code to have this functionality for someone relatively new to JavaScript? I had a look, and was kinda of lost in the source code, but maybe with a little guidance from someone more experienced, I could be able to modify it by myself. Alternatively, how can one add the totals using an external library?
This isn't something that inputs.Table supports directly. I'm not sure if it is something that the maintainers of that library would want to include, but it is an issue that has come up before: https://github.com/observablehq/inputs/issues/148. I think you could post there to try and get some guidance about how to move forward.
Another thing you could do is to modify the data you are passing to the table to add those rows. I made an example of that: https://observablehq.com/d/ed915b04358db27c. There isn't a way to style those rows separately though.
Using an external library, one can easily generate a table with totals. An example of such a library is Tabulator. Here is an example notebook.
I have a PDF file with two kinds of fields: simple text box and drop-down menus with a list of choices. I also have separate plain text tables with information to fill those fields. Ideally, I would like to take this PDF with the fields empty and fill it according to the information I have in the tables.
Therefore, I was wondering if someone can help me to try to solve this problem or at least point me in the right direction. The closest thing that I have found as a solution is to write a javascript that fills the PDF. However, I am afraid that I am not familiar with modifying PDFs nor javascript, and without a clear example it would be difficult for me to understand what is going on. I am familiar with python and R so if anyone knows a solution using those that would be great (I am okay learning new stuff too!).
One last note, the PDF does not come from me, I am trying to avoid copy-pasting work for my colleagues. The tables do come from me so I can modify them as I please.
Thanks.
I'm about to conduct a survey using Qualtrics for my thesis; which requires me to measure choice-induced attitude change using an initial ranking task, followed by a choice task with responses tailored for each participant according to their responses from the ranking task (let's say comparing the options they ranked 'fourth and fifth'), and then the same ranking task again.
I've been having a small problem with it, as Qualtrics doesn't let me impose the correct criteria on 'carry-forward responses' option (needs a little JavaScript code to be embedded into the choice question, apparently). Indeed I found a webpage with instructions on how to do the exact thing: http://kurtmunz.com/2015/05/28/rank-order-carry-forward-in-qualtrics-with-javascript/
Following this logic was partially successful, because it only displays the text associated with selected options, but not the images of the said options, unfortunately. Since displaying the images is critical to my experimental setup, I need to find a solution and I guess the code given in the link just isn't written with the whole image thing in mind.
I was wondering if anybody has faced the same problem and/or has a solution to this.
Thank you very much!!!!
Instead of using insert image, try adding the images to the choices using html. I think the html will become part of the piped choice text. For example:
Choice text<br><img src='xxx' alt='yyy'>
Change the JavaScript to use double quotes around the piped fields.
Personally, I prefer to use a web service to sort and return rankings.
I'm really messed up with javascript, is anyone willing to walk me through setting up a star rating with acts_as_rateable plugin and either http://orkans-tmp.22web.net/star_rating/ or http://rateit.codeplex.com/
I've already got acts_as_rateable set up and working fine. I was following this http://miguelsanmiguel.com/2010/11/28/star-rating-for-rails-3-and-jquery but I hit a wall maybe with jquery 1.6 or something else I can't figure it out.
I believe I need a form_for, a helper and maybe some js code somewhere??
I will need to display multiple ratings on the same page for various items, but only one main item will be rateable.
For the item that you want users to be able to give a rating, you need a form which posts the rating to the corresponding model.
This rubydoc is an instant unobtrusive AJAX solution for rails 2.3
Episode 101 on Refactoring Out Helper Objects might be helpful to watch,
it may be a bit dated since its posted in 2008 but Ryan is good at explaining things
I am trying to build a little test shell for my website using Javascript. What I have at the moment is a normal website. PHP/HTML with an SQL backend.
What I'd like is a simple Javascript feature whereby the user has a single slider object and can use this object to set the upper and lower limit on a number of variables, which will be determined by a drop down box just underneath the slider.
Aside from this, I'd just like a number of checkboxes which dictate which products are displayed (i.e if I'd like food but not drink, the food checkbox would be ticked!).
I'm not expecting anyone on SO to do this for me, of course, but I would like to find some specific areas I could go to learn how to do this, and google is failing me in this regard. I will then begin working/editing this post to show my code/ask for help.
Can anyone help please?
It seems that you want to build a specific search for site, but instead of the user searching it is what is displayed. I would start with looking at php, based upon which checkboxes they choose, you can return variables which would show them what they want to see.
I personally wouldn't use javascipt for this.
I'm not sure what your level of experience is with Javascript, so my apologies if this answer is too basic.
To put a slider on your page refer here for the HTML:
http://webhole.net/2010/04/24/html-5-slider-input-tutorial/
Then in Javascript get the value of that slider when making your GET requests of the server.
You can store the selected value or checked value in the target element, when you process, you just call the element and get the value from them. Using jquery data() method can store the value to element and retrive it pretty easy.
If you still have no clue, I redcomend you learn some basic javscript techniques, go to this site www.jquery.com .
Are you using jQuery and jQuery UI? jQuery UI has a nice slider widget with a number of configuration options and good documentation: http://jqueryui.com/demos/slider/
If you're not used to it, there may be a bit of a learning curve for jQuery, but it makes a great number of UI features much, much easier to code. Showing and hiding elements based on checkboxes, for example, is a pain to do in straight JS but fairly simple to do with jQuery. There are lots of other ways to just make a slider, but if you're planning to do much more with the UI I'd strongly recommend using a library like jQuery to do the heavy lifting.