मेरे पास एक textbox , एक चेकबॉक्स और span टैग है जब मैं चेकबॉक्स पर क्लिक करता हूं, तो उसे span टैग में अपनी स्थिति दिखानी चाहिए। जब टेक्स्टबॉक्स नवीनीकृत हो जाता है, तो वह चेकबॉक्स ब्लॉक फिर से करता है जब आप अब चेकबॉक्स पर क्लिक करते हैं, तो यह राज्य को अपडेट करने में विफल रहता है। मैं चेक बॉक्स क्लिक ईवेंट के लिए पर ईवेंट हैंडलर का उपयोग कर रहा हूं, इसलिए मुझे उम्मीद है कि यह काम करेगा। कोई भी विचार क्यों यह अपेक्षित रूप से काम नहीं कर रहा है?
$ ('div [भूमिका] इनपुट [type = checkbox]')। पर (' क्लिक करें ', chg); $ ('Div [भूमिका] इनपुट [प्रकार = पाठ]')। पर ('इनपुट', स्रोत परिवर्तित); फ़ंक्शन chg () {var isitiki = $ (this) .is (": चेक"); । $ ( '# Upd') एचटीएमएल (istiki); } Function sourceChanged () {$ ('span', $ (this) .closest ('इनपुट-समूह'))। Html ('& lt; इनपुट प्रकार = "चेकबॉक्स" & gt;'); } & lt; script src = "https://ajax.googleapis.com/ajax/libs/ jQuery / 1.11.1 / jquery.min.js "& gt; & lt; / स्क्रिप्ट & gt; & Lt; div भूमिका = "टिकी" वर्ग = "इनपुट-समूह" & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" वर्ग = "फॉर्म-कंट्रोल" / & gt; & Lt; span class = "input-group-addon" & gt; & lt; इनपुट प्रकार = "चेकबॉक्स" /> gt; & lt; / span & gt; & Lt; / div & gt; & Lt; span id = "upd" & gt; & lt; / span & gt;
जैसा कि आप गतिशील रूप से एक नया चेकबॉक्स बनाते हैं जब मान में परिवर्तन होता है, तो आपको घटना को गैर-गतिशील पूर्वजों को निर्दिष्ट करके अपने चेकबॉक्स में देना होगा:
$ ('Div [भूमिका]')। पर ('परिवर्तन', 'इनपुट [प्रकार = चेकबॉक्स]', chg); ध्यान दें कि मैंने परिवर्तन के बजाय को क्लिक के रूप में उपयोग किया है क्योंकि यह चेकबॉक्स के लिए अधिक उपयुक्त है।
नीचे दिए गए स्निपेट में मैंने $ (this) .is (": checked") को सिर्फ this.checked में बदल दिया है।
& lt; script src = "https://ajax.googleapis.com/ajax/libs/ jQuery / 1.11.1 / jquery.min.js "& gt; & lt; / स्क्रिप्ट & gt; & Lt; div भूमिका = "टिकी" वर्ग = "इनपुट-समूह" & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" वर्ग = "फॉर्म-कंट्रोल" / & gt; & Lt; span class = "input-group-addon" & gt; & lt; इनपुट प्रकार = "चेकबॉक्स" /> gt; & lt; / span & gt; & Lt; / div & gt; & Lt; span id = "upd" & gt; & lt; / span & gt; यह भी ध्यान रखें कि यदि आप इसे false आपको अपने istiki चर को स्ट्रिंग में कनवर्ट करना चाहिए: $ ('# upd')। Html ('' + isticki);
Popular posts from this blog
I'm trying to call the Python using the Java program py4j . I've been installing the plug-in Eclipse and test name Piidvi project. I'm trying to execute the following part of the code found on py4j webpage: Import from py4j.java_gateway to JavaGateway, java_import gateway = JavaGateway () jvm = gateway.jvm java_import (jvm, '' Org.eclipse Kkorkrisorsej. * ") Vrkspes_rut = Jvankresourkesplginkgetvrkspas (). GetRoot (Gateway .help (workspace_root, '* Projects *') project_names = [project.getName () (for projects workpace_root.getProjects))] print (Projekt_nam) But I There is an error in import. I have checked that the P4JJ is present in the Jar Eclipse plugin directory. Can anyone help please? I had to install the py4j application
I am new to Python I am trying to parse JSON result from a URL. Basically, I was using the following: response = urllib.request.urlopen (url) json_obj = json.load (response) It should be a stroke "str 'not' bytes' in the lines of a given" JSON object, so after searching on the StackoverView Flo, I decode the response in this way: F = urllib.request.urlopen (Url) charset = f.info (). Get_param ('charset', 'utf8') data = f.read () decoded = json.loads (data.decode (charset)) If I print "decode" I is as follows: { 'link': { 'summary data': 'https: // localhost / piwebapi / streams / p0_7qHaW4UHU-RlCaz8tpasAAQAAAAU0hJTExNQU42NDIwXFNJTlVTT0lE / summary' 'value': 'https: // localhost / Piwebapi / streams / P0_7qHaW4UHU-RlCaz8tpasAAQAAAAU0hJTExNQU42NDIwXFNJTlVTT0lE / price ',' InterpolatedData ':' https: // localhost / Piwebapi / streams / P0_7qHaW4UHU-RlCaz8tpasAAQAAAAU0hJTE...
As stated in the Barjini Stroustrup's "A Tour of C ++", and a known C ++ 14 practice As such, someone should avoid the naked code in the new and delete . Provides std :: make_shared and std :: make_unique to create smart pointers to store allocated items in the standard library. However, it is not possible to use these routines for non-standard smart pointers, such as QT's own memory management model (with parent), but also smart pointer class like Provides QSharedPointer and QPointer (although later it is not actually a brochure indicator). My question is: Is not it convenient to create Qt analog of std :: make_shared ? To like it, QSharedPtr : Namespace Qt {template & lt; Class T, squares ... Args & gt; QSharedPointer & LT; T & gt; Make_shared (erg & amp; ... args) {return QSharedPointer & lt; T & gt; (New t (std :: forward & lt; ergos & gt; (args) ...)); }} or to create this, QPointer : named place ...
Comments
Post a Comment