mercredi 2 mars 2022

the library (@circlon/angular-tree-component) which declares TreeModel has not been processed correctly by ngcc, is not compatible with Angular Ivy

ERROR in node_modules/@circlon/angular-tree-component/lib/models/tree.model.d.ts:7:22 - error 

i am trying to use @circlon/angular-tree-component for the menu in tree-view with checkboxes. and throws error something like...

NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (@circlon/angular-tree-component) which declares TreeModel has not been processed correctly 
by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

7 export declare class TreeModel implements ITreeModel, OnDestroy {

how to resolve this...? thanx.




Python Checkboxes with tkinter and If Condition

I would like to create some kind of prio generator. This is kept very simple. I have 8 different questions and depending on the answer a prioritization is output. This works so far also quite well. However, I have the error that my "Else" condition does not seem to work. Example: If question 1 and question 8 are selected, then the Else condition should output "not possible". Unfortunately this does not work. I have defined the possibilities and everything that is outside the defined rules should run into the else condition. Here is the code:

    from tkinter import *

ws = Tk()
ws.title('Prio Guide')
ws.geometry('600x680')
ws.configure(bg="white")

text = StringVar()
label = Label(  ws,
                text='empty',
                textvariable=text, 
                bg="green")
prio1 = StringVar()
prio1_text = Label( ws,text='empty',textvariable=prio1, bg="white")
prio1.set("Prio 1 - Description")

prio2 = StringVar()
prio2_text = Label( ws, text='empty', textvariable=prio2, bg="white")
prio2.set("Prio 2- Description")

prio3 = StringVar()
prio3_text = Label( ws, text='empty', textvariable=prio3, bg="white")
prio3.set("Prio 3- Description")

prio4 = StringVar()
prio4_text = Label( ws, text='empty', textvariable=prio4, bg="white")
prio4.set("Prio 4- Description")
#define the Prio
def prio():
    if cb.get() == 1 or cb1.get() == 1 or cb2.get() == 1 or cb.get() & cb1.get() == 1 or cb2.get() & cb1.get() == 1 or cb.get() & cb1.get() & cb2.get() == 1:
        text.set("Prio 1")

    elif cb3.get() == 1 or cb4.get() == 1 or cb3.get() & cb4.get() == 1:
        text.set("Prio 2")

    elif cb5.get() == 1 or cb5.get() & cb6.get() == 1:
        text.set("Prio 3")
    elif cb7.get() == 1 or cb6.get() & cb7.get() == 1:
        text.set("Prio 4")
    else:
        text.set("not possible")

#create IntVar fot the value of checkboxes
cb  = IntVar()
cb1 = IntVar()
cb2 = IntVar()
cb3 = IntVar()
cb4 = IntVar()
cb5 = IntVar()
cb6 = IntVar()
cb7 = IntVar()
#create checkbutton
Checkbutton(ws, 
            bg="white", 
            text="q1", 
            variable=cb, 
            onvalue=1,
            offvalue=0,
            command=prio,).pack(anchor=W,padx=(100, 10))
Checkbutton(ws,
            bg="white", 
            text="q2", 
            variable=cb1, 
            onvalue=1, 
            offvalue=0, 
            command=prio).pack(anchor=W,padx=(100, 10))
Checkbutton(ws, 
            bg="white", 
            text="q3", 
            variable=cb2, 
            onvalue=1, 
            offvalue=0, 
            command=prio).pack(anchor=W,padx=(100, 10))
Checkbutton(ws,
            bg="white", 
            text="q4", 
            variable=cb3, 
            onvalue=1, 
            offvalue=0, 
            command=prio).pack(anchor=W,padx=(100, 10))
Checkbutton(ws,
            bg="white", 
            text="q5", 
            variable=cb4, 
            onvalue=1, 
            offvalue=0, 
            command=prio).pack(anchor=W,padx=(100, 10))
Checkbutton(ws,
            bg="white", 
            text="q6", 
            variable=cb5, 
            onvalue=1, 
            offvalue=0, 
            command=prio).pack(anchor=W,padx=(100, 10))
Checkbutton(ws,
            bg="white", 
            text="q7", 
            variable=cb6, 
            onvalue=1, 
            offvalue=0, 
            command=prio).pack(anchor=W,padx=(100, 10))
Checkbutton(ws,
            bg="white", 
            text="q8", 
            variable=cb7, 
            onvalue=1, 
            offvalue=0, 
            command=prio).pack(anchor=W,padx=(100, 10))


label.pack(anchor=S)
prio1_text.pack(anchor=S,padx=(100, 10))
prio2_text.pack(anchor=S,padx=(100, 10))
prio3_text.pack(anchor=S,padx=(100, 10))
prio4_text.pack(anchor=S,padx=(100, 10))
ws.mainloop()

Thanks for your help!




JS Remember me checkbox - info not being recalled

I have the following code as below. The issue is that when I have it in the on the html page the code works fine and when I reload the page the values are prefilled in the input field.

But when I move it to the tools.js file, the fields fail to pre=populate on the form. I would like them to be pre populated on return later.

Any ideas:

<div>
     <label>
     <input type="checkbox" id="customerRemember"  name="remember" > Remember me
     </label><br>
</div>

<input type="submit" id="submitButton" value='Submit'>

and

<script>

// Code to remember user details when remember me option checked on checked fiel------///
const rmCheck = document.getElementById("customerRemember"),
    nameInput = document.getElementById("name"),
    mobileInput = document.getElementById("mobile"),
    emailInput = document.getElementById("email");

if (localStorage.checkbox && localStorage.checkbox !== "") {
  rmCheck.setAttribute("checked", "checked");
  nameInput.value = localStorage.username;
  mobileInput.value = localStorage.usermobile;
  emailInput.value = localStorage.useremail;
} else {
  rmCheck.removeAttribute("checked");
  nameInput.value = "";
  mobileInput.value = "";
  emailInput.value = "";
}

submitButton.onclick =function() {
  if (rmCheck.checked && emailInput.value !== "") {
    localStorage.username = nameInput.value;
    localStorage.usermobile = mobileInput.value;
    localStorage.useremail = emailInput.value;
    localStorage.checkbox = rmCheck.value;
  } else {
    localStorage.username = "";
    localStorage.usermobile = "";
    localStorage.useremail = "";
    localStorage.checkbox = "";
  }
}
</script>



Checkbox event on IEnumerable box

I'm making a c# windows form that from an IEnumerable list of item must create a checkbox and a Textbox for every item, and so far I hav made it without problem. Every textbox and every checkbox have a different name from a Name+counter of the rotation.

I would like to make an event that if I uncheck for example the Chkbox1 make the txtbox1 not editable without know How many checkbox I can have.

I'm a little bit newbie in c#.




C#Checkbox event on IEnumerable box

I'm making a c# windows form that from an IEnumerable list of item must create a checkbox and a Textbox for every item, and so far I hav made it without problem. Every textbox and every checkbox have a different name from a Name+counter of the rotation.

I would like to make an event that if I uncheck for example the Chkbox1 make the txtbox1 not editable without know How many checkbox I can have.

I'm a little bit newbie in c#.

Stefano




mardi 1 mars 2022

How to implement line-through using css to custom checkbox?

    ---------------------------------HTML code----------------------------------------  
       <label class="round">
            <input type="checkbox" id="round-checkbox" class="check-btn">
            <span></span>
        </label>
            <label for="round-checkbox" id="task-text" >Hello Smple TEXT</label> 

-----------------------------------------CSS code-----------------------------------------------

  .round input:checked+label{
    text-decoration: line-through;
}

I tried the above approach but it is not working...




lundi 28 février 2022

How do I delete the cell content in front of cell that have not been checked?

I have cell range. First column have content. Second column have check box. See first picture.first picture I try to clear content infront of unchecked boxes.

    function clearCon() {
var ss = SpreadsheetApp;
var sheet=ss.getActiveSpreadsheet().getSheetByName ("AddData");
var chkval = sheet.getRange("A29:B33").getValues();
Logger.log(chkVal);
Logger.log( chkval.length);
for(var i=0; i<=chkVal.length; i++) { if (chkval[1][1] == false) { sheet.getRange (28, 1, 1+1,1).clearContent(); return;
Logger.log(1);
}
}
}

See this picture code it's not correctly work. How to do this?