Re: [Proto-Scripty] Newbie question: Add CSS style to TR
That contains() method looks darned useful! Try this in its place: $$('td').findAll(function(elm){ return elm.innerHTML.include('Pendiente');}).invoke('setStyle','background- color:#c00'); That's the long-hand way, you could probably wrap this up in a function so there wouldn't be any repeated code. Walter On Aug 31, 2010, at 9:39 AM, VEO creativos wrote: Hi! I'm trying to assign a CSS style to a TR that contains the words "Pendiente", "Procesando" and "Completo". I've made this for jQuery, but I need to do it with prototype/ scriptaculous and I'm a totally newbie. Thanks in advance for any help! This is the code I've made for jQuery: $("td:contains('Pendiente')").css("background", "#c00"); $("td:contains('Procesando')").css("background", "#0c0"); $("td:contains('Completo')").css("background", "#000"); Thanks!! -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Newbie question: Add CSS style to TR
Hey, Setting styles can be done using the the setStyle method: http://api.prototypejs.org/dom/element/setstyle/ Selecting elements using a css selector can be done using the $$ method which is short for Element.select() but then global: http://api.prototypejs.org/language/dollardollar/ http://api.prototypejs.org/dom/element/select/ Since $$ and Element.select both give an array of elements (even it's just 1) you can invoke the setStyle method on each element: http://api.prototypejs.org/language/enumerable/prototype/invoke/ so in your case this should work: $$("td:contains('Pendiente')").invoke('setStyle', { background: '#c00' }); Take a look at the links I mentioned above for possible optimalisations on that code. Greetings, Johan On Tue, Aug 31, 2010 at 3:39 PM, VEO creativos wrote: > Hi! I'm trying to assign a CSS style to a TR that contains the words > "Pendiente", "Procesando" and "Completo". > I've made this for jQuery, but I need to do it with prototype/ > scriptaculous and I'm a totally newbie. > > Thanks in advance for any help! > > This is the code I've made for jQuery: > > $("td:contains('Pendiente')").css("background", "#c00"); > $("td:contains('Procesando')").css("background", "#0c0"); > $("td:contains('Completo')").css("background", "#000"); > > > Thanks!! > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Newbie question: Add CSS style to TR
Hi! I'm trying to assign a CSS style to a TR that contains the words "Pendiente", "Procesando" and "Completo". I've made this for jQuery, but I need to do it with prototype/ scriptaculous and I'm a totally newbie. Thanks in advance for any help! This is the code I've made for jQuery: $("td:contains('Pendiente')").css("background", "#c00"); $("td:contains('Procesando')").css("background", "#0c0"); $("td:contains('Completo')").css("background", "#000"); Thanks!! -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Newbie Question
I am very new to Prototype and JavaScript, so this is prolly a no- brainer for most of you. Let me see if I can make sense... On my page, there is a DIV where my ajax calls load pages. The main page loads with a specific form loaded in the div. The user clicks a link that calls another page (Group Manager) to load in the div. One of the options on that page is to remove a member from this group by clicking a delete button. when the button is clicked, I am calling the script that actually deletes the member. I have this function running and everything works fine, but what I cannot figure out is how to is to reload the "Group Manager" page after the delete script runs. Right now all I get is a blank page in the div. There is a function to load that page. Here is what I have: UserRemoveGroupMember = function(WGUID) { lmnt = "UserContent"; new Ajax.Updater( lmnt, 'src/DeleteGroupMember.php', { parameters: 'WGUID='+ WGUID, evalScripts: true, method: 'post', onSuccess: function() { UserProfileToggleManageGroups(); } } ); } I hope I made sense.. lol Thanks folks! -Mike D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] newbie question
I have the weirdest problem and am looking for some pointers troubleshooting it if you have a couple of minutes? I'm adding prototype & prototip to an existing site. Prototip (using Prototype) works absolutely fine under firefox 3.03; behaviour is 100% as expected and firebug reports 0 errors. It works under IE7 also, but screws up the first (html) SELECT on 2 pages (but not the rest). The issue is that all of the values display as blank in the select, but the html code looks clean in a "view source". I stripped back the code so that prototip is not used at all (i.e. not even loaded) and the problem still occurs. I disable:-
[Proto-Scripty] Newbie question
I've done Javascript and PHP coding, but decided to get started with AJAX - but I'm having a problem that's probably something dumb on my part. I've got a page that sends out the following centre=userLogin&username=akdfk&password=%3Bkda%3Bkj In the PHP program, I've put some code to just figure out if it got there - which it does. However, when I do a if(isset($_GET["centre"])) echo "centre is set"; else echo "centre is not set"; in the PHP program, it always comes bacak that centre is not set. What should I be looking for? Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---