Fix per ExpGroupBy di WSS3 su FireFox

mercoledì, 7 maggio 2008 09.35 by Marco Bellinaso

Quando da SharePoint Designer si crea una DataView webpart con un qualche raggruppamento, il codice auto-generato fa uso della funzione ExpGroupBy per l'effetto di apertura/chiusura dei gruppi. Sfortunatamente tale feature non funziona in FireFox, alla faccia del tanto propagandato supporto cross-browser. La cosa simpatica (si fa per dire) è che il raggruppamento all'interno delle liste standard di WSS funziona bene anche in FireFox invece -- ma in quel caso la funzione usata è ExpCollGroup.

Sono andato a vedermi il codice della funzione ExpGroupBy, presente nel file Core.js, scoprendo che semplicemente la funzione termina subito se il browser è FF! Surprised Ma perchè? Non c'è nessun limite tecnico, è una cosa semplice tutto sommato. Togliendo tale condizione e provando il codice si scopre però che effettivamente la funzione non va su FF...ma, di nuovo, non per limiti tecnici, quanto perchè tale funzione è stata scritta abbastanza da schifo usando javascript non standard! (le variabili non sono dichiarate, gli array sono acceduti tramite (x) invece di [x], e qualcos'altro ancora). Pur non essendo assolutamente un esperto di javascript mi sono armato di FireBug sono riuscito a metterla un po' a posto in modo da farla funzionare sia su IE che su FF. Di seguito potete scaricare il risultato:

Download ExpGroupBy.txt (2,34 kb)

Il nuovo codice lo potete sostituire al codice originale all'interno di Core.js, oppure (soluzione preferita e da me adottata) inserire all'interno di un file .js custom da referenziare nella masterpage *dopo* Core.js (in modo che ne faccia l'override). 

Il problema si è risolto con uno sforzo relativamente basso, ma:
1) Era proprio necessario far codificare due funzioni molti simili a due persone diverse?
2) Possibile che chi ha implementato ExpGroupBy non sia andato a vedersi come era stata codificata (correttamente) ExpCollGroup?
3) Possibile che l'autore di ExpGroupBy non si sia posto il problema di come rendere cross-browser una funzione così semplice, invece di escludere a priori FF?
4) Possibile che nessuno abbia testato una funziona che è sicuramente usata in un mare di webpart create da SharePoint Designer, e abbia sollevato ua bandierina alla scoperta del problema? (soprattutto considerato che nelle liste standard la funzione sorella non ha problemi...almeno per coerenza fatele o non fatele funzionare entrambe!)

Tutto questo mostra come anche in MS non tutti gli sviluppatori siano dei fenomeni (e si presume che chi ha codificato quella funzione sia anche un esperto di JS, altrimeni si sarebbe occupato di codice di back-end o di altra roba) 

Correntemente valutato 5.0 da 1 utenti

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Segnala:  
Tags:   , , ,
Categorie:   Sviluppo software | Windows
Azioni:   E-mail | Permalink | Commenti (12) | RSS CommentiRSS comment feed

Post correlati

Commenti

dicembre 6. 2009 03.47

payday loans

Keep working ,great job!

payday loans

gennaio 3. 2010 15.26

fast payday loans

I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!

fast payday loans

febbraio 13. 2010 11.08

teeth whitening

Very interesting post - Might be old new, but it was new to me.

teeth whitening

febbraio 16. 2010 14.57

Colon cleansing

my God, i thought you were going to chip in with some decisive insght at the end there, not leave it with "we leave it to you to decide".

Colon cleansing

febbraio 22. 2010 11.59

Acne treatment

I usually dont post in Blogs but your blog forced me to, amazing work.. beautiful

Acne treatment

febbraio 27. 2010 19.42

cash advance

Very interesting post - Might be old news, but it was news to me.

cash advance

marzo 6. 2010 02.07

gazeteler

Fine information, many thanks to the author. It is puzzling to me now, but in general, the usefulness and significance is overwhelming. Very much thanks again and good luck!

gazeteler

marzo 6. 2010 16.22

instant loans

my God, i thought you were going to chip in with some decisive insght at the end there, not leave it with ‘we leave it to you to decide’. Big thanks for the useful info i found on Fix per ExpGroupBy di WSS3 su FireFox.

instant loans

marzo 9. 2010 10.52

replica watches

thanks for the share

replica watches

marzo 10. 2010 11.22

bad credit loans

I keep listening to the news talk about getting free online grant applications so I have been searching around for the best site to get one. Big thanks for the useful info i found on Fix per ExpGroupBy di WSS3 su FireFox.

bad credit loans

marzo 14. 2010 14.12

Migrain

Great resource, if only I new the langaugs better i would check it more often but
I'm afiad of migrain
Now my asian frind helps me to translate, thanks to him and those who run this blog!

Migrain

marzo 15. 2010 13.14

Stretch marks

good good…this post deserves nothing Frown …hahaha just joking Tong …nice post Tong

Stretch marks

Aggiungi commento


(Visualizza la tua icona Gravatar)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Anteprima

marzo 20. 2010 10.27