prototypejs


Php Javascript alternative for jquery grid

ぃ、小莉子 提交于 2020-01-17 08:22:23
问题 I want an alternative to a jquery grid for crud operations in php. I want to use a simple table with facilities such as searching, sorting an pagination. Is there any library for this? Can i use prototype.js for achieving this? Please guide me. 回答1: The only jQuery library out there that sort of is what you need is jqGrid. I am sufficiently unhappy with it that I am in the middle of writing my own grid for CRUD. FlexiGrid is better code and looks nicer but it is missing a lot. jqGrid is

Running JS/JQuery inside of prototype

大憨熊 提交于 2020-01-17 07:42:32
问题 I'm having a problem with Prototype Draggable windows.. I have a window and i want to launch some jQuery/Ajax/JavaScript functions inside of the window but seems like nothing works. Look an example i've made with a simple JavaScript popup script and when i click the div it doesn't show, same happens with every function i do. <script type="text/javascript"> function show_confirm() { var r = confirm("Press a button!"); if (r == true) { alert("You pressed OK!"); } else { alert("You pressed

observing multiple select menus with prototype

人走茶凉 提交于 2020-01-17 01:27:12
问题 I want to observe multiple select menus and respond to their changes using prototype but only the first menu seems to be observed. This is my code: $('product_options').select('select').invoke("observe","change",optchange); If there are - for example - 3 selects within product_options then it only observes the first, i thought it might be because of invoke so i then tried this: $('product_options').select('select').each(function(sel){ $(sel).observe("change",optchange); }); Still doesnt work

smooth scroll not working in firefox, works fine in IE

假如想象 提交于 2020-01-17 01:10:28
问题 My beloved Firefox is losing to IE on this. Anyone know why this won't function in Firefox? (doesn't even go to anchor), but scrolls smoothly in IE? document.observe("dom:loaded", function() { if ($$('a.scroll')) { $$('a.scroll').invoke('observe','click', function(event) { Event.stop(event); var elementLink = Event.element(event).readAttribute('href'); var scrollHere = elementLink.substr(1, elementLink.length); Effect.ScrollTo(scrollHere); return false; }); } }); applied as such: <a class=

Passing a form object to a partial rendered from an ajax request

爷,独闯天下 提交于 2020-01-16 18:57:58
问题 I have an event form with some nested attribute models. The additional models are rendered after a client is selected from a select box. An observer watches and calls a controller action which renders a partial containing the fields_for nested models. The issue I'm having is that I can't pass the event 'form' block to the newly rendered partial - at least I can't figure out how... The code below raises the error: "wrong number of arguments (0 for 1)". Any help or suggestions are appreciated.

Stop Event in IE 9 (without upgrading to Prototype 1.7)

和自甴很熟 提交于 2020-01-15 15:14:49
问题 The site I'm working on uses Prototype 1.6.1. Its Event.stop() doesn't work in IE9. I know that Prototype 1.7 fixes the problem. However, is there a walk-around if I cannot upgrade to Prototype 1.7? I need the site to be compatible with IE 7, 8 and 9 (as well as Chrome, Firefox, etc). Thanks! EDIT: I tried event.preventDefault() and it doesn't work for me in IE 9. Here is an example: http://jsfiddle.net/garthcn/AdR7g/ It works in jsfiddle/Chrome/Firefox. If you paste the code to an HTML file

Stop Event in IE 9 (without upgrading to Prototype 1.7)

对着背影说爱祢 提交于 2020-01-15 15:11:48
问题 The site I'm working on uses Prototype 1.6.1. Its Event.stop() doesn't work in IE9. I know that Prototype 1.7 fixes the problem. However, is there a walk-around if I cannot upgrade to Prototype 1.7? I need the site to be compatible with IE 7, 8 and 9 (as well as Chrome, Firefox, etc). Thanks! EDIT: I tried event.preventDefault() and it doesn't work for me in IE 9. Here is an example: http://jsfiddle.net/garthcn/AdR7g/ It works in jsfiddle/Chrome/Firefox. If you paste the code to an HTML file

Stop Event in IE 9 (without upgrading to Prototype 1.7)

守給你的承諾、 提交于 2020-01-15 15:11:47
问题 The site I'm working on uses Prototype 1.6.1. Its Event.stop() doesn't work in IE9. I know that Prototype 1.7 fixes the problem. However, is there a walk-around if I cannot upgrade to Prototype 1.7? I need the site to be compatible with IE 7, 8 and 9 (as well as Chrome, Firefox, etc). Thanks! EDIT: I tried event.preventDefault() and it doesn't work for me in IE 9. Here is an example: http://jsfiddle.net/garthcn/AdR7g/ It works in jsfiddle/Chrome/Firefox. If you paste the code to an HTML file

PrototypeJS get value of each input

ぐ巨炮叔叔 提交于 2020-01-15 05:15:06
问题 I write following function to read inputs from my fieldset , it works but I have no idea how to read value of selected this way input $$('#split_edit div label input').each( function(item) { console.log(item); } ); This is my html structure, I can't read input value using its ID because they are dynamically generated. <fieldset id="split_edit"> <div class="top-10"> <label> <span class="span-3 left">Item 1 (%)</span> <input type="text" class="text" name="packet_1" value="0" id="packet_3"> <

What is the best field validation plugin for Prototype?

牧云@^-^@ 提交于 2020-01-14 06:09:05
问题 Not wanting to re-invent the wheel or anything, I was wondering if there's a plugin out there a field or form validation plugin that works with Prototype that you can recommend from your own experience and why? 回答1: I like Ben Keen's Really Simple Validation component. Features I like: All the validation rules can be kept within javascript so you're not adding class="required" to your HTML code. You can display error messages in a javascript alert box or with HTML text. Adding your own

工具导航Map