Dyes and metal ions which are the major components of effluents from industries such as textile, paper, leather, cosmetics and plastic, prove to be the most harmful and toxic of all the contaminants. Especially, Ni2+ as colorant and methylene blue (MB) are contained in the wastewater of printing and dyeing plant. Herein, novel porous dimethylglyoxime (DMG)/TiO2/polyacrylonitrile (PAN) nanofiber mats were prepared via electrospinning to treat Ni2+ and MB mixture pollutants. The formation of red and virgulate Ni(DMG)2 on the nanofiber surface indicated that the composite possessed visible adsorption capacity (48.6895 mg g−1 in 120 min) as a benefit of the capability of DMG to sense Ni2+. Most importantly, the DMG/TiO2-decorated PAN nanofiber mats exhibited excellent photocatalytic MB degradation efficiency (97 % within 60 min) owing to the construction of heterjunctions between Ni(DMG)2 and TiO2 nanoparticles and the shortening of electron and hole transport paths by hierarchical structures. The skillful use of Ni(DMG)2 as an intermediate for photocatalytic MB degradation suggested that these functionalized nanofiber mats are promising candidates for practical application in sensing, heavy metal ion adsorption, and photocatalytic organic pollutant degradation.