Questions tagged [dynamic-class]
45 questions
1
vote
2 answers
What is the difference between class syntax and type()?
I am well aware of fact that classes can be declared dynamically in python using type and have used it here and there. But I am still unclear what are the differences between these two functions.
def class_factory():
def init(self, attr):
…

Nafees Anwar
- 6,324
- 2
- 23
- 42
1
vote
1 answer
Binding different css classes the elements created by v-for
I got the elements created by v-for, and i want to give different css classes these elements according to data.To do that I need a way to reach activeNumbers without v-for or use v-for without itteration.

Rahmi Kostik
- 11
- 2
1
vote
2 answers
Angular ngClass: apply class dynamically
I am unable to set the class dynamically. Please guide me through. Thanks.
I have a class in SCSS file as below:
.form-validation.invalid {
border: 2px solid red
}
My ts file has a variable names isEmailValid, when ever this variable is false…

Anna
- 1,669
- 7
- 38
- 63
1
vote
1 answer
How to implement resize() to change capacity of dynamic member data in c++
I need to implement the function resize() :
void IntSet::resize(int new_capacity)
{
if (new_capacity < used)
new_capacity = used;
if (used == 0)
new_capacity = 1;
capacity = new_capacity;
int * newData =…

Maria Fernanda
- 29
- 1
- 10
1
vote
1 answer
passing information from child class to parent, using dynamic classes in kvlang (Kivy)
How can I pass information from a child class to its parent in kvlang, using dynamic classes?
I have the following simple kv code and Python code:
kv:
BoxLayout:
Label:
id: label_id
text: 'label'
Button1:
mylabel: label_id
text:…

yoel
- 305
- 4
- 17
1
vote
1 answer
PHP: Call Class' Static Method with Dynamic Class Name pre PHP 5.3
Im working on a project for a legacy codebase, using php 5.2.6. Part of this project involves something akin to A/B testing using one PHP class vs another. The two classes have many of the same function names, with very similar signatures, but…

Todd
- 2,824
- 2
- 29
- 39
1
vote
0 answers
How to make generic method with TypeDelegator argument?
Faced interesting problem. C# runtime throws "Not Supported" exception when I attempt to call a generic method constructed with TypeDelegator argument. Here is the example:
using System;
using System.Reflection;
using…

Andrew
- 2,055
- 2
- 20
- 27
1
vote
1 answer
ParseException: No property or field '???' exists in type 'DynamicClass' when using GroupBy and Select
I'm using EntityFramework together with System.Linq.Dynamic and I've defined Employee POCO class as follows:
public class Employee
{
public long Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
…

Stef Heyenrath
- 9,335
- 12
- 66
- 121
0
votes
1 answer
How to use dynamic className with TypeAnimation component?
I am using a package called
react-type-animation
for a typewriter text effect with react and tailwind css. But when I add dynamic class to the TypeAnimation component, it does not work. Here is the code that I have tried:

Shakil Ahmed
- 39
- 1
- 5
0
votes
0 answers
Why are my CSS classes not updating in Blazor WASM?
I'm trying to change the class of a element based on a bool. I'm saving the value of the bool in the localstorage and the Console.WriteLine shows me that SidenavClass gets the correct value (class name). However, it does not update in the…

KroSral
- 126
- 6
0
votes
1 answer
Dynamic class binding doesn't work in Vue
I'm using Vue2 and I face some problems with dynamic class binding (highlight in the navigation menubar the current section name in which the user is currently). I'm using the Intersection observerAPI which I initialize and let it loop over my…

Kilian Kramer
- 89
- 5
0
votes
1 answer
Dynamically select DbSet member from DbContext?
I want to create a dynamic OData controller which can be inherited by concrete OData controllers. In order to do that, I need to way to select the proper DbSet from my DbContext and use it in the controller. However, I have no clue how to write this…

Razzupaltuff
- 2,250
- 2
- 21
- 37
0
votes
1 answer
OData Queries on Entities with Dynamic Fields
I am using OData on a dynamic model. The MyObject data is stored in two different ways on the database - in a main MyObject table and in a secondary table of key/value pairs. The allowed field names for the secondary table are stored in a third…

ChristyPiffat
- 359
- 1
- 6
- 26
0
votes
1 answer
Beautiful soup returns empty while using class name to filter datas
Im trying to retrieve the product names, weight and price in a list from the following site.
https://www.licious.in/seafood
my code to find the products list :
import requests
from bs4 import BeautifulSoup
URL =…

showstopper
- 41
- 5
0
votes
0 answers
Groovy dynamic class with method with parameters
I am new to Groovy and trying to create dynamic classes with methods with parameters. I went through the following thread and it helped me to get started: Create a Groovy class dynamically .
But it didn't show how to create add methods with…

Ronin
- 1
- 1