@tayfunerbilen Hocam o şekilde yaptığımdada alt dive etki etmiyor yani şöyle
<WindowVirtualizer>
<div
style={{
width: "100%",
flexGrow: 1,
display: "flex",
justifyContent: "flex-start",
flexWrap: "wrap",
}}
>
{productList.map((item, index) => (
<Product classProps="search-product" key={index} product={item} />
))}
</div>
</WindowVirtualizer>
Bu şekilde yaptığımda virtua çalışmıyor
<div className="list">
<WindowVirtualizer>
{productList.map((item, index) => (
<Product classProps="search-product" key={index} product={item} />
))}
</WindowVirtualizer>
</div>
Bu şekilde yaptığımda grid çalışmıyor
Herhangi bir örnekte yok WindowScroll gridle alakalı çözemiyorum
onChange ile çözebilirsiniz arkadaşlar
<Input
clearable
type="password"
bordered
label="Şifre"
value={input}
onChange={(e) => setInput(e.target.value)}
/>
``
@tayfunerbilen Hocam bu konuda bir yol gösterebilir misiniz?
const newArray = products.map((item, i) => {
if (index === i) {
///Update function
return {
...item,
[e.target.name]: e.target.value,
};
} else {
return item;
}
});
setProducts(newArray);
Bu tipte çözdüm teşekkür ederim
Açıklaman için teşekkür ederim ancak state eşzamansız şekilde güncelleniyor bunu kontrol edebiliyorum ama state güncellemesi sonrası kontrol ediyorum güncellenmiş evet daha sonra fetch fonksiyonunu çağırdığımda filter state bir öncekini güncellenmemişi göndermekte
@tayfunerbilen hocam bu konuda sizin bir fikriniz var mı?
Aşağıdaki gibi düzeltme sağladım şuanlık sağlıklı çalışıyor sizinde görüşünüzü almak isterim @ebykdrms
$detail = $this->connect->query("SELECT * FROM entg_sales WHERE orderDate BETWEEN '$orderDate' AND '$orderEndDate' AND (auth = '$this->appkey' and orderStatus='$orderStatus') ORDER BY id DESC");
$rowPD = $detail->rowCount();
$orderList = [];
$whereConditions = [];
$whereConditionsWithESD = [];
if ($rowPD > 0) {
$detail = $detail->fetchAll(PDO::FETCH_ASSOC);
foreach ($detail as $keys) {
$whereConditions[] = "(orderId='" . $keys["orderId"] . "' AND auth='" . $this->appkey . "')";
$whereConditionsWithESD[] = "(ESD.orderId='" . $keys["orderId"] . "' AND ESD.auth='" . $this->appkey . "')";
}
$whereCondition = implode(" OR ", $whereConditions);
$whereConditionWithESD = implode(" OR ", $whereConditionsWithESD);
$detail = $this->connect->query("select orderId,packageId,totalDiscount,totalPrice,orderDate,agreedDeliveryDate,Platform,orderStatus from entg_sales WHERE $whereCondition")->fetchAll(PDO::FETCH_ASSOC);
$adress = $this->connect->query("select orderId,firstName,lastName,fullName,address,city,district,type,fullAddress from entg_sales_adress WHERE $whereCondition")->fetchAll(PDO::FETCH_ASSOC);
$cargoDetail = $this->connect->query("SELECT orderId,cargoTrackingNumber,cargoProviderName,cargoPrice FROM entg_sales_cargo WHERE $whereCondition")->fetchAll(PDO::FETCH_ASSOC);
$customerDetail = $this->connect->query("SELECT orderId,customerFirstName,customerLastName,customerEmail,customerFullName,tcIdentityNumber,taxOffice,taxId FROM entg_sales_customer WHERE $whereCondition")->fetchAll(PDO::FETCH_ASSOC);
$list = $this->connect->query("SELECT ESD.orderId,ESD.barcode, ESD.productName, ESD.productCode, ESD.merchantCode, ESD.productSize, ESD.quantity, ESD.amount, ESD.discount, ESD.price, ESD.attributeValue, ESD.Tax, ESD.salesCampaignId, EP.barcode, P.barcode, ( SELECT imageName FROM product_images WHERE barcode = P.barcode ORDER BY imageName DESC LIMIT 1 ) AS imageName, P.purchase, P.purchaseTax, P.discount1, P.discount2, P.discount3, P.tax FROM entg_sales_detail ESD LEFT JOIN entg_product EP ON ESD.barcode = EP.barcode AND ESD.auth = EP.auth LEFT JOIN product_images PM ON EP.mainBarcode = PM.barcode AND EP.auth = PM.auth LEFT JOIN product P ON P.barcode = PM.barcode AND P.auth = PM.auth WHERE $whereConditionWithESD GROUP BY ESD.barcode ORDER BY imageName ASC")->fetchAll(PDO::FETCH_ASSOC);
$orderList = [
"detail" => $detail,
"adress" => $adress,
"cargoDetail" => $cargoDetail,
"customerDetail" => $customerDetail,
"list" => $list
];
$orderListESD = [];
foreach ($orderList["detail"] as $detail) {
$array = [
"detail" => $detail,
"adress" => array(),
"cargoDetail" => [],
"customerDetail" => [],
"list" => array()
];
foreach ($orderList["adress"] as $adress) {
if ($detail["orderId"] == $adress["orderId"]) {
array_push($array["adress"], $adress);
}
}
foreach ($orderList["cargoDetail"] as $cargoDetail) {
if ($detail["orderId"] == $cargoDetail["orderId"]) {
$array["cargoDetail"] = $cargoDetail;
}
}
foreach ($orderList["customerDetail"] as $customerDetail) {
if ($detail["orderId"] == $customerDetail["orderId"]) {
$array["customerDetail"] = $customerDetail;
}
}
foreach ($orderList["list"] as $list) {
if ($detail["orderId"] == $list["orderId"]) {
array_push($array["list"], $list);
}
}
$orderListESD[] = $array;
}
$orderList = $orderListESD;
}
Galiba hallettim sorunu.
const [loading, setLoading] = useState(true);
const [rootAll, setRootAll] = useState([]);
const [chartOptions, setChartOpitons] = useState();
const [chartData, setChartData] = useState([]);
useEffect(() => {
const fetchData = async () => {
await fetch("https://localhost/api/root/all/static")
.then((response) => response.json())
.then((response) => {
setRootAll(response);
setLoading(false);
});
};
fetchData();
}, []);
useEffect(() => {
rootAll &&
setChartOpitons({
plugins: {
title: {
display: true,
},
legend: {
display: false,
},
},
responsive: true,
interaction: {
mode: "index",
intersect: false,
},
scales: {
x: {
stacked: true,
},
y: {
stacked: true,
},
},
});
}, []);
const labels = [
"00:00",
"01:00",
"02:00",
"03:00",
"04:00",
"05:00",
"06:00",
"07:00",
"08:00",
"09:00",
"10:00",
"11:00",
"12:00",
"13:00",
"14:00",
"15:00",
"16:00",
"17:00",
"18:00",
"19:00",
"20:00",
"21:00",
"22:00",
"23:00",
];
useEffect(() => {
rootAll &&
setChartData({
labels,
datasets: [
{
label: "Satış Miktarı",
data: [
rootAll.hoursGraphic && rootAll.hoursGraphic["01:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["02:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["03:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["04:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["05:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["06:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["07:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["08:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["09:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["10:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["11:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["12:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["13:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["14:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["15:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["16:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["17:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["18:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["19:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["20:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["21:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["22:00"],
rootAll.hoursGraphic && rootAll.hoursGraphic["23:00"],
],
backgroundColor: "rgb(255, 99, 132)",
},
],
});
return () => {};
}, [rootAll.hoursGraphic]);
if (loading) {
return <div> Loading ... </div>;
}
useEffectin çıkış dependency state.hoursGraphic'i dinlemesini söylediğimde loadinge bile gerek kalmadı küçük bir kaçış noktası :)
return () => {};
}, [rootAll.hoursGraphic]);
N: Bu kodun daha temizi yazılabilir mi?
Çözümü bulamadım component ilk render olduğunda boş array dönmekte bunu nasıl engelleyebilirim ? Çünkü fetch request sonrası kod save edildiğinde verileri grafiğe yansıyor ama ilk boş döndüğü için kontrolda sağlasam yinede işe yaramıyor