It is narrated from Hamid bin Abdullah bin Yazid Al-Madani:
Ali (ع) had passed a judgement and when his ruling was mentioned to the holy Prophet (ص), he became very happy and said:
“Praise be to Allah, Who has placed wisdom in us, Ahl al-Bayt.”
Ahmad ibn Hanbal, Fazail-e-Sahaba, V.2, page 654; Qunduzi, Yanabi al-Muwadda, V.2, page 366-367.
And in another tradition he said: “Praise be to Allah Who placed among my Ahl al-bayt such a person who judges the way David (Dawood) (a.s.) did.”
Ibn Marduyeh Esfahani, Al-Manaqib, page 92.
Also, refer to Humaidi, Musnad, V.2, p.345, hadith 785; Suyuti, Al-Jami' al-Kabir, V.15, p.636, hadith 406.